<a href=doc.html DEFANGED_OnMouseOver="document.status='Click me!'; return
true">
When the mouse passes over the example link, the browser executes the
JavaScript statements. (Here, the JavaScript itself is embedded in
the attribute, since it is so simple. Notice that the statements are
enclosed in quotes and separated by a semicolon, and that single
quotes surround the text-message portion of the first statement.)
While a complete explanation of this code is beyond our scope, the
net result is that the browser places the message
"Click me!" in the status bar of
the browser window. Commonly, HTML authors use this simple JavaScript
function to display a more descriptive explanation of a hyperlink, in
place of the often cryptic URL the browser traditionally displays in
the status window.
HTML supports a rich set of event handlers through related
"on" event attributes. The value of
any event handler attribute is either the name of a function defined
elsewhere in the document, or a quoted string containing one or more
script statements separated by semicolons. Extremely long statements
can be broken across several lines, if needed.
An effort is underway at the W3C to implement a standard,
platform-neutral DOM specification for web and XML applications. DOM
Level 1 defined a core object model for HTML and XML documents. It
provides for standard document navigation and manipulation. DOM Level
2 provides an event model and a model for style sheets and
manipulating style information.
Currently, browsers support their own specific object models, which
roughly comply with DOM Level 1. Currently, DOM Level 2 has been
partially implemented in the latest generation of browsers.