Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

EventTarget

BaselineWidely available *

Note: This feature is available inWeb Workers.

TheEventTarget 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 asDocument andWindow, are the most common event targets,but other objects can be event targets, too.For exampleIDBRequest,AudioNode, andAudioContext are also event targets.

Many event targets (including elements, documents, and windows) also support settingevent handlers viaonevent properties and attributes.

Constructor

EventTarget()

Creates a newEventTarget object instance.

Instance methods

EventTarget.addEventListener()

Registers an event handler of a specific event type on theEventTarget.

EventTarget.removeEventListener()

Removes an event listener from theEventTarget.

EventTarget.dispatchEvent()

Dispatches an event to thisEventTarget.

Specifications

Specification
DOM
# interface-eventtarget

Browser compatibility

See also

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp