|Modifier and Type||Method and Description|
This method allows the registration of event listeners on the event target.
This method allows the removal of event listeners from the event target.
void addEventListener(java.lang.String eventType, DOMEventListener listener)
DOMEventListeneris added to an
DOMEventTargetwhile 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
DOMEventTargetwith the same parameters the duplicate instances are discarded. They do not cause the
DOMEventListenerto be called twice and since they are discarded they do not need to be removed with the
eventType- the event type for which the user is registering. E.g. "click".
listenerparameter 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)
DOMEventListeneris removed from an
DOMEventTargetwhile it is processing an event, it will not be triggered by the current actions.
DOMEventListeners can never be invoked after being removed.
removeEventListenerwith arguments which do not identify any currently registered
DOMEventTargethas no effect.
eventType- specifies the event type of the
DOMEventListenerbeing removed. E.g. "click".
DOMEventListenerparameter indicates the
DOMEventListenerto be removed.