Permalink Goal for this Lesson

In the last lesson we used some JavaScript to move a funny looking stick person around the screen. Today we’re going to build on that having you write some JavaScript yourself.

Today we’re going to see if we can learn a more about JavaScript. To do this we’re going to use our reference, Mozilla.

Permalink Create the html and JavaScript files

www/javascript.html:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
<!DOCTYPE html>
<html>
  <head>
    <title>Webpage</title>
  </head>
  <body>
    <h1>Main heading</h1>
    <p>This page will use JavaScript!</p>
    <script src="main.js"></script>
  </body>
</html>

www/main.js:

1
2
// You're javascript will go here
//

Permalink Variables

Look at the reference and follow their example on how to use JavaScript variables. This will wind up adding some html and JavaScript to your page such that you can load it, be prompted for your name, and have your name ultimately written to the page! Feel free to use your html file above, to practice what you read. Read the entire page.

At the bottom you’ll find a link to Test your skills!. Give it a try :)

You will likely have questions, ask your teacher!

Good luck!