Document.attachEvent() (Method)

A means of attaching events to windows and documents.


JScript - 5.0
Internet Explorer - 5.0
Property/method value type:Boolean primitive
JavaScript syntax:IEmyDocument.attachEvent(anEventName, anEventHandler)
Argument list:anEventHandlerA reference to an event handler function
anEventNameThe name of an event to be handled

This is part of the behavior handling in MSIE which involves the use of style sheets and .htc files. It is a way of binding a function to an event so that when the event fires, the function is called. It can be applied in a more general way than just with behaviors.

See also:<STYLE>, Document.detachEvent(), Window.attachEvent(), Window.detachEvent()