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:
<script>
.... </script>
<script language="javascript">
Specifically for the Hello World Program:
Figure: Hello World JavaScript Example