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 time.
Script code can be written directly in the HTML document inside:SCRIPT elements
Intrinsic event attributes
HTML scripting Wikipedia
SCRIPT elements may occur zero or more times within the HEAD and BODY elements. Scripts within script elements are processed as the document loads.
Events occur for different elements of a web-page:Documents (BODY and FRAMESET)
UI elements (Anchor, Control Element, Image)
Document and UI elements
Lost focus with modified content
onChange (also OPTION)
Some browsers support additional event attributes (outside the standard), such as:onResize
The HTML 4.01 specification reserves a syntax for the "future support of script macros" in HTML attributes, but they have not been incorporated into later standards and are not supported by any current browser. A polyfill (entities.js) has been created in order to allow "script macros" in browsers that do not natively support this feature.