Education Online for Computer Software, Web Development, and Microsoft Office
Home  ->  Learn More About Web Dev, Software Applications, Microsoft Office, and Computers

Learn About HTML Scripting


Cascading Style Sheets
Character encodings
Layout engine comparison
Dynamic HTML
Font family
HTML editor
HTML element
HTML scripting
Unicode and HTML
Web colors

The W3C HTML standard includes support for client-side scripting. It defines how locally executable scripts may be used in a web page. A particular client-side application, such as a web browser, may support several script languages. Script code may be executed as the document loads or at a later event.

Script code can be written directly in the HTML document inside:

The SCRIPT element

The SCRIPT element may occur zero or more times within the HEAD and BODY tag. Scripts within script elements are processed as the document loads.

Intrinsic event attributes

Events occur for different elements of a web-page:

Script code may be associated with an event and element by writing code in an HTML attribute. The name of the attribute must be that of a supported intrinsic event for the element (for example, "onLoad"). The script is executed whenever the event occurs for that element.

The HTML intrinsic event model consist of the following events:

Some browsers support additional event attributes (outside the standard), such as:

Script macros

Script code may be included as an HTML attribute value. The code must be preceded by an ampersand. NOTE: Script macros are often left out of implementations.

Retrieved from ""
Personal tools
In other languages



All text is available under the terms of the GNU Free Documentation License (see Copyrights for details).