trait EventTarget extends Object
EventTarget is an interface implemented by objects that can receive events and may have listeners for them.
Element, document, and window are the most common event targets, but other objects can be event targets too, for example XMLHttpRequest, AudioNode, AudioContext, and others.
Many event targets (including elements, documents, and windows) also support setting event handlers via on... properties and attributes.
- Annotations
- @RawJSType() @native()
- See also
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
- Alphabetic
- By Inheritance
- EventTarget
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addEventListener(type: String, listener: Function, useCapture: Boolean): Unit
Register an event handler of a specific event type on the EventTarget.
Register an event handler of a specific event type on the EventTarget.
- listener
The object that receives a notification (an object that implements the Event interface) when an event of the specified type occurs. This must be an object implementing the EventListener interface, or simply a JavaScript function.
- useCapture
A Boolean that indicates that events of this type will be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree. Events that are bubbling upward through the tree will not trigger a listener designated to use capture. Event bubbling and capturing are two ways of propagating events that occur in an element that is nested within another element, when both elements have registered a handle for that event. The event propagation mode determines the order in which elements receive the event. See DOM Level 3 Events and JavaScript Event order for a detailed explanation. If not specified, useCapture defaults to false.
-
def
addEventListener(type: String, listener: Function, options: |[EventTargetOptions, RawOptions]): Unit
Register an event handler of a specific event type on the EventTarget.
Register an event handler of a specific event type on the EventTarget.
- listener
The object that receives a notification (an object that implements the Event interface) when an event of the specified type occurs. This must be an object implementing the EventListener interface, or simply a JavaScript function.
- options
An options object that specifies characteristics about the event listener.
-
def
addEventListener(type: String, listener: Function): Unit
Register an event handler of a specific event type on the EventTarget.
Register an event handler of a specific event type on the EventTarget.
- listener
The object that receives a notification (an object that implements the Event interface) when an event of the specified type occurs. This must be an object implementing the EventListener interface, or simply a JavaScript function.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
dispatchEvent(event: Event): Boolean
Dispatch an event to this EventTarget.
Dispatch an event to this EventTarget.
- event
event is the Event object to be dispatched.
- returns
false if event is cancelable and at least one of the event handlers which handled this event called Event.preventDefault(). Otherwise it returns true.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
removeEventListener(type: String, listener: Function, useCapture: Boolean): Unit
Removes an event listener from the EventTarget.
Removes an event listener from the EventTarget.
- listener
The EventListener function to remove from the event target.
- useCapture
Specifies whether the EventListener to be removed is registered as a capturing listener or not. If this parameter is absent, a default value of false is assumed. If a listener is registered twice, one with capture and one without, remove each one separately. Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.
-
def
removeEventListener(type: String, listener: Function, options: |[EventTargetOptions, RawOptions]): Unit
Removes an event listener from the EventTarget.
Removes an event listener from the EventTarget.
- listener
The EventListener function to remove from the event target.
- options
An options object that specifies characteristics about the event listener.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )