HTML5 JS API Index > DOM Tutorials & Specs
Extended by CustomEvent, AutocompleteErrorEvent, RelatedEvent, PopStateEvent, HashChangeEvent, PageTransitionEvent, BeforeUnloadEvent, ErrorEvent, MessageEvent, CloseEvent, TrackEvent, StorageEvent, IDBVersionChangeEvent, OfflineAudioCompletionEvent, AudioProcessingEvent, TimeEvent, TimeEvent, WebGLContextEvent
An event allows for signaling that
something has occurred. E.g. that an image has completed downloading. It is
represented by the Event interface or an interface that
inherits from the Event interface.
Properties |
const unsigned short | - AT_TARGET = 2
- When an event is
dispatched it will be in this
phase on its target attribute value.
|
const unsigned short | - BUBBLING_PHASE = 3
- When an event is
dispatched to an object that
participates in a
tree it will be in this phase after it
reaches its target attribute value.
|
const unsigned short | - CAPTURING_PHASE = 1
- When an event is
dispatched to an object that
participates in a
tree it will be in this phase before it
reaches its target attribute value.
|
const unsigned short | - NONE = 0
- Events not currently
dispatched are in this phase.
|
boolean | - bubbles
- The bubbles and
cancelable attributes
must return the values they were initialized to.
|
boolean | - cancelable
- The bubbles and
cancelable attributes
must return the values they were initialized to.
|
EventTarget? | - currentTarget
- The target and
currentTarget
attributes must return the values they were initialized to. When an
event is created the attributes must be
initialized to null.
|
boolean | - defaultPrevented
- The
defaultPrevented
attribute must return true if the canceled flag is set and
false otherwise.
|
unsigned short | eventPhase |
boolean | - isTrusted
- The isTrusted attribute
must return the value it was initialized to. When an
event is created the attribute must be
initialized to false.
|
EventTarget? | - target
- The target and
currentTarget
attributes must return the values they were initialized to. When an
event is created the attributes must be
initialized to null.
|
DOMTimeStamp | - timeStamp
- The timeStamp attribute
must return the value it was initialized to. When an
event is created the attribute must be
initialized to the number of milliseconds that have passed since
00:00:00 UTC on 1 January 1970, ignoring leap seconds.
|
DOMString | - type
- The type attribute must
return the value it was initialized to. When an
event is created the attribute must be
initialized to the empty string.
|
Constructor |
---|
Event(DOMString type, optional EventInit eventInitDict) |
Operations |
void | - initEvent(DOMString type, boolean bubbles, boolean cancelable)
- The
initEvent(type, bubbles, cancelable)
method must initialize the
context object with type,
bubbles, and cancelable.
|
void | - preventDefault()
- The
preventDefault()
method must set the canceled flag if the
cancelable attribute value is true.
|
void | - stopImmediatePropagation()
- The
stopImmediatePropagation()
method must set both the stop propagation flag and
stop immediate propagation flag.
|
void | - stopPropagation()
- The
stopPropagation()
method must set the stop propagation flag.
|