Allows registration and removal of an EventListener on an EventTarget.
Browser/User Agent Support
| IE | Mozilla | Netscape | Opera | Safari | Netscapte | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
|---|
Constructors
| Constructor | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Allows registration and removal of an EventListener on an EventTarget. | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
Methods
| Method | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Adds an event listener to the set of event listeners for the node. | no | 1.0+ | no | 7.0+ | 1.0+ | no |
Dispatches an event created by Document.createEvent(). | no | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
Removes an event listener from an event target. | no | 1.0+ | no | 7.0+ | 1.0+ | no |
References
Availability
HTML DOM Level 2 | W3C
Constructor Detail
EventTarget EventTarget()
Allows registration and removal of an EventListener on an EventTarget.
- Visibility
- internal
Method Detail
addEventListener(String type, EventListener listener, Boolean useCapture) : void
Adds an event listener to the set of event listeners for the node.
| String | type | Type of event for the event listener. |
| EventListener | listener | Event listener function to be invoked. |
| Boolean | useCapture | Specify "true" to invoke the event listener during the capturing phase of event propagation. Specify "false" to invoke the event listener when the node is the event target or when the event bubbles up to the current node. |
-
For examples, see the quirksmode test page:
- See Also
- Availability
HTML DOM Level 2 | W3C
dispatchEvent(Event event) : Boolean
Dispatches an event created by Document.createEvent().
| Event | event | Specifies Event object to be dispatched. |
- Throws
- Raises an UNSPECIFIED_EVENT_TYPE_ERR error if the type of Event was not specified by initializing the event before calling dispatchEvent, or if the Event type was null or an empty string.
- See Also
Document.createEvent | Event.initEvent | MouseEvent.initMouseEvent
- Availability
HTML DOM Level 2 | W3C
removeEventListener(String type, EventListener listener, Boolean useCapture) : void
Removes an event listener from an event target.
| String | type | Type of event. |
| EventListener | listener | Event listener to be removed. |
| Boolean | useCapture | Specify "true" to remove a capturing event listener. Specify "false" to remove all other types of event listeners. |
-
For examples, see the quirksmode test page:
- Availability
HTML DOM Level 2 | W3C
