next up previous
Next: A Simple Example 1 Up: First Steps in JavaScript Previous: Running Javascript

A Simple Example 1 -- Hello World

The script that follows could hardly be easier. We'll list the code first then explain what's going on.

<html>
 <head>
   <title> Hello World JavaScript</title>
 </head>

<body >
<script language="javascript">
 
   var str = "Hello World";

   window.alert(str);
 
   document.write("<h1>" + str + "</h1>");
 
</script>


</body>
</html>

The key points of JavaScript Programs:

Specifically for the Hello World Program:


next up previous
Next: A Simple Example 1 Up: First Steps in JavaScript Previous: Running Javascript
Dave Marshall
9/28/2001