Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

I am learning Javascript

Featured Replies

So I just started learning Javascript and I might have a lot of questions about it. Please excuse me if I get annoying with my questions..I am just trying to understand how Javascript works. I'm learning from the W3School website just for anyone information. Okay let's get started!

 

 

<!DOCTYPE html>

<html>

<body>

 

<h1>My Web Page</h1>

 

<p id="demo">A Paragraph.</p>

 

<script type="text/javascript">

document.getElementById("demo").innerHTML="My First JavaScript";

</script>

 

</body>

</html>

 

So basically the code above has Javascript using an ID named Demo. The ID is used to make a paragraph so that it can be incorporated into HTML is what I am guessing...However to make that work the... document.getElementById("demo")

is what makes the ID work. Right? So, without that the code won't work right.

u need to add an event with it to make it work

<script type="text/javascript">
function changeText(){
document.getElementById('boldStuff').innerHTML = 'Fred Flinstone';
}
</script>
<p>Welcome to the site <b id='boldStuff'>dude</b> </p> 
<input type='button' onclick='changeText()' value='Change Text'/>

 

 

see here

 

see here for some simple examples

Edited by sash_oo7

  • Author

I see now. Thank you! I am understanding a bit better. :) I was curious about the "boldstuff" though...I'm guessing that is how you make words bold?

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.