Use the 'script' tag to incluse your javascript code : Source File « Language Basics « JavaScript Tutorial






<html>
<head>
<title>Title of Document</title>

<script>

// All Your Javascript Code goes In Here Between the opening and closing script tags.

</script>

</head>
<body>

The content of
your page here.

</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