Define script in HEAD section : Source File « Language Basics « JavaScript Tutorial






<html>
<head>

<script>
alert("Do you see the page heading?");
</script>
</head>
<body>
<h1>Page heading</h1>
</body>
</html>








1.7.Source File
1.7.1.Use the 'script' tag to incluse your javascript code
1.7.2.HTML Template Page supporting the JavaScript
1.7.3.Define script in HEAD section
1.7.4.Define javascript code in BODY section
1.7.5.Define message in one block and output it in another
1.7.6.Reference javascript source file stored outside
1.7.7.Mix simple code with HTML
1.7.8.Mix complicated code with HTML