EventTarget class
The 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.
- Implementers
- AbortSignal
- Animation
- AudioNode
- AudioRenderCapacity
- AudioTrackList
- BackgroundFetchRegistration
- BaseAudioContext
- BatteryManager
- Bluetooth
- BluetoothDevice
- BluetoothRemoteGATTCharacteristic
- BluetoothRemoteGATTService
- BroadcastChannel
- Clipboard
- CloseWatcher
- CookieStore
- CSSPseudoElement
- DevicePosture
- EditContext
- EventSource
- FileReader
- FontFaceSet
- GPUDevice
- Hid
- HIDDevice
- IDBDatabase
- IDBRequest
- IDBTransaction
- IdleDetector
- Keyboard
- MediaDevices
- MediaKeySession
- MediaQueryList
- MediaRecorder
- MediaSource
- MediaStream
- MediaStreamTrack
- MessagePort
- MIDIAccess
- MIDIPort
- NamedFlow
- Navigation
- NavigationHistoryEntry
- NDEFReader
- NetworkInformation
- Node
- Notification
- OffscreenCanvas
- PaymentRequest
- PaymentResponse
- Performance
- PermissionStatus
- PictureInPictureWindow
- PortalHost
- PresentationAvailability
- PresentationConnection
- PresentationConnectionList
- PresentationRequest
- Profiler
- RemotePlayback
- RTCDataChannel
- RTCDtlsTransport
- RTCDTMFSender
- RTCIceTransport
- RTCPeerConnection
- RTCSctpTransport
- ScreenDetails
- ScreenOrientation
- Sensor
- Serial
- SerialPort
- ServiceWorker
- ServiceWorkerContainer
- ServiceWorkerRegistration
- SharedWorker
- SourceBuffer
- SourceBufferList
- SpeechRecognition
- SpeechSynthesis
- SpeechSynthesisUtterance
- TextTrack
- TextTrackCue
- TextTrackList
- Usb
- VideoTrackList
- VirtualKeyboard
- VisualViewport
- WakeLockSentinel
- WebSocket
- Window
- WindowControlsOverlay
- Worker
- WorkerGlobalScope
- XMLHttpRequestEventTarget
- XRLayer
- XRLightProbe
- XRSession
- XRSpace
- XRSystem
- Available extensions
- Annotations
-
- @JS()
- @staticInterop
Constructors
- EventTarget()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addEventListener(
String type, EventListener? callback, [dynamic options]) → void -
Available on EventTarget, provided by the PropsEventTarget extension
-
dispatchEvent(
Event event) → bool -
Available on EventTarget, provided by the PropsEventTarget extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeEventListener(
String type, EventListener? callback, [dynamic options]) → void -
Available on EventTarget, provided by the PropsEventTarget extension
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited