HTML Reference Guide
<SCRIPT> ... </SCRIPT> SCRIPT
Scripts can exist either embedded within a document or may be located elsewhere. If the script code is contained within a web page, it will be embedded within an HTML comment between the Script container tags (nesting within a comment is important in order to make the script invisible to browsers that do not support the feature.) Statements are evaluated when the document is loaded. If a Script attempts to reference document objects defined by HTML elements occurring later in the document, the attempt will fail. Because of this, it is generally safest to place a SCRIPT statement at the top of a document in the HEAD element.
NOTE: Scripts can also be invoked using the A element combined with Script code in place of the destination URL. This allows a script (either inline or located in a SCRIPT element) to be executed when the user clicks on a hyperlink.
charset - This indicates the character encoding of the script contents.
defer - This stand alone attribute is used to advise the browser that the script is not going to generate any rendered document content and thus, the user agent can continue parsing and rendering.
language - This attribute indicates the scripting language the script is written in. It is required if the SRC attribute is not specified, optional otherwise.
src - This attribute specifies an external source for the script code.
type - This attribute specifies the MIME type of the scripting code.
onblur - A blur Event Handler executes Script code when a form field or layer loses focus.
onchange - A change Event Handler executes Script code when a form field loses focus and its value has been modified. This event handler is used to validate data after it is modified by a user.
onclick - A click Event Handler executes Script code when an object is clicked.
onfocus - A focus Event Handler executes Script code when a form field or layer receives input focus by tabbing with the keyboard or clicking with the mouse. Important: Selecting within a form field results in a onSelect event, not a onFocus event.
onload - This attribute executes Script code with the completion of loading of a window, layer, or when all frames within a Frameset have finished loading. In a Frame document scenario, an onLoad event in the BODY element of a sub-frame will occur before an onLoad event within the parent FRAMESET element.
onmouseover - A mouseOver Event Handler executes Script code once each time the mouse pointer enters the bounds of an object from outside the object.
onmouseout - A mouseOout Event Handler executes Script code once each time the mouse pointer exits the bounds of an object from inside the object.
onselect - A select Event Handler executes Script code when a user selects some of the text within a form field.
onsubmit - A submit Event Handler executes Script code when a user submits a form. It can also be used to prevent a form from being submitted; to do so, put a return statement that returns false in the event handler. Any other returned value lets the form submit. If you omit the return statement, the form is submitted.
onunload - An unLoad Event Handler executes Script code when the user exits a document. In a Frame document scenario, an onUnload event in the BODY element of a sub-frame will occur before an onUnload event within the parent FRAMESET element.
Please enter your name: