public interface DOMEventTarget
DOMNode
that supports DOM event model.| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(java.lang.String eventType,
DOMEventListener listener)
This method allows the registration of event listeners on the event
target.
|
void |
removeEventListener(java.lang.String eventType,
DOMEventListener listener)
This method allows the removal of event listeners from the event
target.
|
void addEventListener(java.lang.String eventType,
DOMEventListener listener)
DOMEventListener is added to an
DOMEventTarget while it is processing an event, it will not
be triggered by the current actions but may be triggered during a
later stage of event flow, such as the bubbling phase.
DOMEventListeners are registered
on the same DOMEventTarget with the same parameters the
duplicate instances are discarded. They do not cause the
DOMEventListener to be called twice and since they are
discarded they do not need to be removed with the
removeEventListener method.eventType - the event type for which the user is registering. E.g. "click".listener - the listener parameter takes an interface
implemented by the user which contains the methods to be called
when the event occurs.void removeEventListener(java.lang.String eventType,
DOMEventListener listener)
DOMEventListener is removed from an
DOMEventTarget while it is processing an event, it will not
be triggered by the current actions. DOMEventListeners can
never be invoked after being removed.
removeEventListener with arguments which do
not identify any currently registered DOMEventListener on
the DOMEventTarget has no effect.eventType - specifies the event type of the DOMEventListener
being removed. E.g. "click".listener - the DOMEventListener parameter indicates the
DOMEventListener to be removed.