public interface EventListener
EventListener
interface is the primary way for handling
events. Users implement the EventListener
interface and
register their event listener on an EventTarget
. The users
should also remove their EventListener
from its
EventTarget
after they have completed using the listener.
Copying a Node
, with methods such as
Node.cloneNode
or Range.cloneContents
, does not
copy the event listeners attached to it. Event listeners must be attached
to the newly created Node
afterwards if so desired.
Moving a Node
, with methods Document.adoptNode
, Node.appendChild
, or Range.extractContents
,
does not affect the event listeners attached to it.
See also the Document Object Model (DOM) Level 3 Events Specification .
Modifier and Type | Method and Description |
---|---|
void |
handleEvent(Event evt)
This method is called whenever an event occurs of the event type for
which the
EventListener interface was registered. |
void handleEvent(Event evt)
EventListener
interface was registered.evt
- The Event
contains contextual information
about the event.Copyright © 2000–2023 Apache Software Foundation. All rights reserved.