3
Embedded javascript with a <SCRIPT> tag and end with </SCRIPT>. It is recommended that you include type and language statements inside the script tag, <SCRIPT TYPE="text/javascript" LANGUAGE="Javascript_version">. The SRC attribute can be used in the script tag to include a separate file containing the script, like <SCRIPT TYPE="text/javascript" LANGUAGE="Javascript_version" SRC="javascript.js">. <NOSCRIPT> is an alternative for non javascript capable browsers. By default scripts are executed as the page loads.
Code comments are started with // if they are single line. Multi line comments are started with /* and ended with */. Use HTML comment statements <!- and //--> to hide your javascript from browsers that don't support javascript. Buttons are created with basic HTML form structure.
Example:It is recommended to declare variables in the <HEAD> section of the page. var command is used to declare variables.
<SCRIPT TYPE="text/javascript" LANGUAGE="Javascript_1.2">The examples above set the variable variableName to 3 then 5.23 and finally to "String goes here".