public interface EventListener
EventListener
interface is the primary method for
handling events. Users implement the EventListener
interface
and register their listener on an EventTargetEventListener
from its EventTarget
after they
have completed using the listener.
Copying a Node
with the Node.cloneNode
method 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
or Node.appendChild
, does not affect the event listeners
attached to it.
The EventListener behavior follows the description in section 1.2.2 of the DOM Level 3 Events specification.
See also the Document Object Model (DOM) Level 3 Events Specification and .
Modifier and Type | Method and Description |
---|---|
void |
handleEvent(Event evt)
This method is called whenever an event occurs of the 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 © 2013, Oracle and/or its affiliates. All rights reserved.
Use is subject to License Terms. Your use of this web site or any of its contents or software indicates your agreement to be bound by these License Terms.