Event : Object
Event contains information describing the current event such as a click or
download event. It is the first parameter to event listener callbacks.
See
%%/MouseEvent|MouseEvent%%,
%%/KeyboardEvent|KeyboardEvent%%,
and
%%/ProgressEvent|ProgressEvent%% for some derivations of Event.
Spec:
https://dom.spec.whatwg.org/#interface-event
----
new Event( \
type : String, \
[eventInit : { \
bubbles : Boolean, \
cancelable: Boolean \
}]) : Event
Creates a new Event. Use %%/EventTarget#dispatchEvent|**dispatchEvent()**%% to
fire the event.
Parent
--Child
----
instance.type : String
A string describing the type of event.
Click Me
ReadOnly:
true
----
instance.target : Object
The **Object** that originated this event. See also %%#currentTarget|**currentTarget**%%.
Click Me (parent)
--Click Me (child)
ReadOnly:
true
----
instance.currentTarget : Object
The **Object** that the current callback is running for.
This will be the element that registered the listener and
will different than %%#target|**target**%% if this
event is in the bubble or capture phase.
Click Me (parent)
--Click Me (child)
ReadOnly:
true
----
instance.eventPhase : Number
The current phase of the event. Will be one of
%%#NONE|**NONE**%%,
%%#CAPTURING_PHASE|**CAPTURING_PHASE**%%,
%%#AT_TARGET|**AT_TARGET**%%, or
%%#BUBBLING_PHASE|**BUBBLING_PHASE**%%.
Click Me (parent)
--Click Me (child)
ReadOnly:
true
----
instance.bubbles : Boolean
Returns **true** if the event will bubble up through the ancestor
hierarchy.
ReadOnly:
true
----
instance.cancelable : Boolean
Returns **true** if the event can be canceled (by calling %%#preventDefault|**preventDefault()**%%).
ReadOnly:
true
----
instance.timeStamp : Number
The time (in milliseconds since 01 January, 1970 UTC) that the event fired. Use
%%/Date|Date%% to convert to a human readable time.
Click Me
ReadOnly:
true
----
instance.defaultPrevented : Boolean
Returns **true** if %%#preventDefault|**preventDefault()**%% has been called on
**this**.
Click Me (parent)
--Click Me (child)
ReadOnly:
true
----
instance.isTrusted : Boolean
ReadOnly:
true
----
prototype.stopPropagation() : undefined
Stops event listeners on other nodes in the event route from running. Other
listeners attached to %%#currentTarget|**currentTarget**%% will still run.
See also
%%#stopImmediatePropagation|**stopImmediatePropagation()**%%
and %%#preventDefault|**preventDefault()**%%.
Click Me (parent)
--Click Me (child)
----
prototype.stopImmediatePropagation() : undefined
Stops other event listeners on this node and on other nodes in the event route
from running. See also
%%#stopPropagation|**stopPropagation()**%% and
and %%#preventDefault|**preventDefault()**%%.
Click Me (parent)
--Click Me (child)
Spec:
https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation
----
prototype.preventDefault() : undefined
Stops the browser's default behavior from running for the current event.
Only %%#cancelable|**cancelable**%% events can have their default behavior prevented.
See also %%#stopPropagation|**stopPropagation()**%%
and %%#stopImmediatePropagation|**stopImmediatePropagation()**%%.
preventDefault
----
NONE : Number
Returned by %%#eventPhase|**eventPhase**%% before the event is routed.
ReadOnly:
true
----
CAPTURING_PHASE : Number
Returned by %%#eventPhase|**eventPhase**%% during the capture phase of the
event route.
ReadOnly:
true
----
AT_TARGET : Number
Returned by %%#eventPhase|**eventPhase**%% when at the target that originated the event.
ReadOnly:
true
----
BUBBLING_PHASE : Number
Returned by %%#eventPhase|**eventPhase**%% during the bubbling phase of the
event route.
ReadOnly:
true