EventTarget object (Object/DOM)

A set of properties and methods that extend the behavior of DOM nodes to support event handling.


DOM level - 2
JavaScript - 1.5
Netscape - 6.0
JavaScript syntax:NmyEventTarget = myEvent.currentTarget
NmyEventTarget = myEvent.target
NmyEventTarget = myMouseEvent.currentTarget
NmyEventTarget = myMouseEvent.relatedTarget
NmyEventTarget = myMouseEvent.target
NmyEventTarget = myMutationEvent.currentTarget
NmyEventTarget = myMutationEvent.target
NmyEventTarget = myUIEvent.currentTarget
NmyEventTarget = myUIEvent.target
Object methods:addEventListener(), dispatchEvent(), removeEventListener()

Netscape version 6 introduces this capability and adds the EventTarget methods and properties to its Node objects. This provides the necessary tools for registering and deregistering event listeners and for dispatching an event to a Node.

See also:MouseEvent.initMouseEvent(), MouseEvent.relatedTarget, MutationEvent.initMutationEvent(), Node object

addEventListener()1.5 1.5 n/a6.0 6.0 n/a n/a n/a n/a2 2 n/a n/a-
dispatchEvent()1.5 1.5 n/a6.0 6.0 n/a n/a n/a n/a2 2 n/a n/a-
removeEventListener()1.5 1.5 n/a6.0 6.0 n/a n/a n/a n/a2 2 n/a n/a-