Name

FOR — NN n/a IE 4 HTML n/a

Synopsis

FOR=elementID
                  

Optional

Internet Explorer 4’s event model allows binding of object events to SCRIPT elements with the help of the EVENT and FOR attributes. As the page loads, the browser registers each SCRIPT element with its event and object binding so that when the object generates the event, the script statements inside the SCRIPT element execute—without having to write event handlers for the objects or wrap the script statements inside function definitions. Use the unique ID attribute value of the element whose event you wish to handle. Use this type of script-event binding only in Internet Explorer. Navigator attempts to execute the script statements while the page loads.

Example

<SCRIPT FOR=firstNameEntry EVENT="onChange()">
...
</SCRIPT>

Value

Case-sensitive ID value of the event-generating element, unquoted. The object described in the FOR attribute must support the event named in the EVENT attribute.

Default

None.

Object Model Reference

IE

[window.]document.all.elementID.htmlFor

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.