DOM

DOM

Source
event = new Event(type [, eventInitDict]) Returns a new event whose type attribute value is set to type. The eventInitDict argument allows for setting the bubbles and cancelable attributes via object members of the same name. event . type Returns the type of event, e.g. "click", "hashchange", or "submit". event . target Returns the object to which event is dispatched (its target). event . currentTarget Returns the object whose event listener’s callback is currently being invoked. event . composedPath() Returns the invocation target objects of event’s path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root’s mode is "closed" that are not reachable from event’s currentTarget. event . eventPhase Returns the event’s phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. event . stopPropagation() When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. event . stopImmediatePropagation() Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. event . bubbles Returns true or false depending on how event was initialized. True if event goes through its target’s ancestors in reverse tree order; otherwise false. event . cancelable Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. event . preventDefault() If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. event . defaultPrevented Returns true if preventDefault() was invoked successfully to indicate cancelation; otherwise false. event . composed Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target; otherwise false. event . isTrusted Returns true if event was dispatched by the user agent, and false otherwise. event . timeStamp Returns the event’s timestamp as the number of milliseconds measured relative to the time origin.

Event/type

In all current engines.

Firefox1+Safari1+Chrome1+ Opera7+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ Node.js14.5.0+

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.

Event/target

In all current engines.

Firefox1+Safari1+Chrome1+ Opera7+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ Node.js14.5.0+

The target getter steps are to return this’s target.

The srcElement getter steps are to return this’s target.

Event/currentTarget

In all current engines.

Firefox1+Safari10+Chrome1+ Opera7+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari10+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+ Node.js14.5.0+

The currentTarget attribute must return the value it
was initialized to. When an event is created the attribute must be initialized to null.

Event/composedPath

In all current engines.

Firefox52+Safari10+Chrome53+ Opera40+Edge79+ Edge (Legacy)NoneIENone Firefox for Android52+iOS Safari10+Chrome for Android53+Android WebView53+Samsung Internet6.0+Opera Mobile41+ Node.js14.5.0+

The composedPath() method steps are:



Read Next page

Report Page