EventTarget
The EventTarget interface is implemented by objects that can receive events and may have listeners for them.
In other words, any target of events implements the three methods associated with this interface.
Element, and its children, as well as Document and Window, are the most common event targets,
but other objects can be event targets, too.
For example XMLHttpRequest, AudioNode, and AudioContext are also event targets.
Many event targets (including elements, documents, and windows) also support setting event handlers via onevent properties and attributes.
Constructor
EventTarget()-
Creates a new
EventTargetobject instance.
Methods
EventTarget.addEventListener()-
Registers an event handler of a specific event type on the
EventTarget. EventTarget.removeEventListener()-
Removes an event listener from the
EventTarget. EventTarget.dispatchEvent()-
Dispatches an event to this
EventTarget.
Specifications
| Specification |
|---|
| DOM Standard (DOM) # interface-eventtarget |
Browser compatibility
BCD tables only load in the browser
See also
- Event reference – the events available in the platform.
- Introduction to events
Eventinterface

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
