Using the Head for Definitions : JavaScript in HTML « Development « JavaScript DHTML






Using the Head for Definitions


<HTML>
<HEAD>
<TITLE>Using the HEAD for definitions</TITLE>
<SCRIPT language="JavaScript">
<!--
    greeting = "Hi Web surfers!"
// -->
</SCRIPT>
</HEAD>

<BODY>
<SCRIPT language="JavaScript">
<!--
    document.write(greeting)
// -->
</SCRIPT>
</BODY>
</HTML>
           
       








Related examples in the same category

1.HTML comment that hides the script.
2.JavaScript Embedded in an HTML File
3.Using HTML Comments to Hide JavaScript Code
4.Embedding JavaScript in HTML
5.Inserting Source JavaScript Files
6.A Basic JavaScript Starter Document
7.JavaScript Template File
8.Embedding a JavaScript Function