EventTarget
EventTarget is an interface defined by the Web Platform that represents any object to which event listeners can be attached and from which events can be dispatched. It is a foundational element of the DOM event system. In browsers, many core objects implement EventTarget, including Window, Document, and Element instances, as well as several API-specific objects.
The interface provides three primary methods: addEventListener, removeEventListener, and dispatchEvent. addEventListener registers a listener for a
Listeners can be registered with either a boolean capture flag or an options object. The options may
Events flow through a target in three phases: capture, target, and bubble. During capturing, events travel from
In practice, EventTarget provides a unified mechanism for event registration and dispatch across environments, supporting decoupled