public interface EventTarget
EventTarget
is a DOM interface implemented by objects that can receive DOM events and have listeners for them. The most common EventTarget
s are DOM elements, although other objects can be EventTarget
s too, for example document, window, XMLHttpRequest, and others.Modifier and Type | Method and Description |
---|---|
EventRemover |
addEventListener(String type,
EventListener listener)
Register an event handler of a specific event type on the
EventTarget . |
EventRemover |
addEventListener(String type,
EventListener listener,
boolean useCapture)
Register an event handler of a specific event type on the
EventTarget . |
boolean |
dispatchEvent(Event event)
Dispatch an event to this
EventTarget . |
void |
removeEventListener(String type,
EventListener listener)
Removes an event listener from the
EventTarget . |
void |
removeEventListener(String type,
EventListener listener,
boolean useCapture)
Removes an event listener from the
EventTarget . |
EventRemover addEventListener(String type, EventListener listener)
EventTarget
.EventRemover addEventListener(String type, EventListener listener, boolean useCapture)
EventTarget
.boolean dispatchEvent(Event event)
EventTarget
.void removeEventListener(String type, EventListener listener)
EventTarget
.void removeEventListener(String type, EventListener listener, boolean useCapture)
EventTarget
.Copyright © 2018. All rights reserved.