Binds the specified function to an event, so that the function gets called whenever the event fires on the object.
- event [in]
String that specifies any of the standard DHTML Events.
- pDisp [in]
Type: ObjectPointer that specifies the function to call when event fires.
Type: BooleanBoolean. Returns one of the following possible values:
The function was bound successfully to the event.
The function was not bound to the event.
There are no standards that apply here.
When event fires on the object, the object's event handler is called before pDisp, the specified function. If you attach multiple functions to the same event on the same object, the functions are called in random order, immediately after the object's event handler is called.
The attachEvent method enables a behavior to handle events that occur on the containing page. This method is not limited, however, to behaviors. You can also define a function on a page that attaches to events fired on the same page.
A behavior that attaches to events on the page using the HTML Component (HTC) PUBLIC:ATTACH element automatically stops receiving notifications when the behavior detaches from the element, and does not need to call the detachEvent method.
Note To use the attachEvent method with Microsoft Visual Basic Scripting Edition (VBScript), you need to use the GetRef to obtain a function pointer. The function pointer can then be passed to attachEvent.
The attachEvent method has been deprecated and samples have been removed. Microsoft recommends the use of addEventListener instead.
- input type=button
- input type=checkbox
- input type=file
- input type=hidden
- input type=image
- input type=password
- input type=radio
- input type=reset
- input type=submit
- input type=text
- Introduction to DHTML Behaviors
- Using DHTML Behaviors
- Using HTML Components to Implement DHTML Behaviors in Script
Build date: 1/23/2013