A Possible Answer:


<html>
<head>
   <SCRIPT type="text/javascript">
    function vars()
    {
       numsums=10 + 2
       alert("10 + 2 is " + numsums)
       var x = 10
       alert("ten is " + x)
       y = x * 2
      alert("10 X 2 = " + y)
       z = "Hello " + "Good Bye"
      alert(z)
    }
   </SCRIPT>
</head>
<BODY OnLoad="vars()">
<h1>Welcome to my Home Page</h2>
</body>
</html>

We will be doing lots more with variables as we learn new commands in JavaScript. For now just be sure you are comfortable with what we've done so far.

Ready to go on?

Close this window to return to JavaScript Primer