<SCRIPT [language="JavaScript]> .... </SCRIPT>
<html> <head> <title>The title of the document</title> <SCRIPT language="JavaScript"> //functions go here </SCRIPT> </head> <body> the main text of the document <SCRIPT language="JavaScript"> //some more code goes here </SCRIPT> </body> </html> |
Javascript code can be present in any part of a document
and is enclosed by the <SCRIPT> tag.
Its probably best to keep the functions in the header part of the document. |
Only certain browsers support scripting. Others will simply ignore the <SCRIPT> and </SCRIPT> tags and display the text between them. To prevent this happenning script tags should be embedded in comments: | <html> <head> <title>The title of the document</title> <SCRIPT language="JavaScript"> <!-- //code goes here // --> </SCRIPT> </head> <body> the main text of the document </body> </html> |
onChange
onclick
onFocus
onLoad
onMouseOver
This text sets the status | This text clears the status |
onSelect
onSubmit
onUnload