public interface Event
This chapter describes the DOM Event Model. The Event interface itself is described, as well as the interfaces for event registration on nodes in the DOM, and event listeners, and several longer examples that show how the various event interfaces relate to one another.
There is an excellent diagram that clearly explains the three phases of event flow through the DOM in the DOM Level 3 Events draft.
Modifier and Type | Method and Description |
---|---|
Clipboard |
getClipboardData() |
EventTarget |
getCurrentTarget()
A reference to the currently registered target for the event.
|
int |
getEventPhase()
Indicates which phase of the event flow is being processed.
|
EventTarget |
getSrcElement() |
EventTarget |
getTarget()
A reference to the target to which the event was originally dispatched.
|
double |
getTimeStamp()
The time that the event was created.
|
String |
getType()
The name of the event (case-insensitive).
|
void |
initEvent(String eventTypeArg,
boolean canBubbleArg,
boolean cancelableArg)
Initializes the value of an Event created through the
DocumentEvent interface. |
boolean |
isBubbles()
A boolean indicating whether the event bubbles up through the DOM or not.
|
boolean |
isCancelable()
A boolean indicating whether the event is cancelable.
|
boolean |
isCancelBubble()
A boolean indicating whether the bubbling of the event has been canceled or not.
|
boolean |
isDefaultPrevented()
Indicates whether or not
event.preventDefault()
has been called on the event. |
boolean |
isReturnValue() |
void |
preventDefault()
Cancels the event (if it is cancelable).
|
void |
setCancelBubble(boolean arg) |
void |
setReturnValue(boolean arg) |
void |
stopImmediatePropagation()
For this particular event, no other listener will be called.
|
void |
stopPropagation()
Stops the propagation of events further along in the DOM.
|
static final String CLICK
static final String CONTEXTMENU
static final String DBLCLICK
static final String CHANGE
static final String MOUSEDOWN
static final String MOUSEMOVE
static final String MOUSEOUT
static final String MOUSEOVER
static final String MOUSEUP
static final String MOUSEWHEEL
static final String FOCUS
static final String FOCUSIN
static final String FOCUSOUT
static final String BLUR
static final String KEYDOWN
static final String KEYPRESS
static final String KEYUP
static final String SCROLL
static final String BEFORECUT
static final String CUT
static final String BEFORECOPY
static final String COPY
static final String BEFOREPASTE
static final String PASTE
static final String DRAGENTER
static final String DRAGOVER
static final String DRAGLEAVE
static final String DROP
static final String DRAGSTART
static final String DRAG
static final String DRAGEND
static final String RESIZE
static final String SELECTSTART
static final String SUBMIT
static final String ERROR
static final String WEBKITANIMATIONSTART
static final String WEBKITANIMATIONITERATION
static final String WEBKITANIMATIONEND
static final String WEBKITTRANSITIONEND
static final String INPUT
static final String INVALID
static final String TOUCHSTART
static final String TOUCHMOVE
static final String TOUCHEND
static final String TOUCHCANCEL
static final int AT_TARGET
static final int BUBBLING_PHASE
static final int CAPTURING_PHASE
static final int NONE
boolean isBubbles()
boolean isCancelBubble()
void setCancelBubble(boolean arg)
boolean isCancelable()
Clipboard getClipboardData()
EventTarget getCurrentTarget()
boolean isDefaultPrevented()
event.preventDefault()
has been called on the event.int getEventPhase()
boolean isReturnValue()
void setReturnValue(boolean arg)
EventTarget getSrcElement()
EventTarget getTarget()
double getTimeStamp()
String getType()
void initEvent(String eventTypeArg, boolean canBubbleArg, boolean cancelableArg)
DocumentEvent
interface.void preventDefault()
void stopImmediatePropagation()
void stopPropagation()
Copyright © 2018. All rights reserved.