This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

dispatchEvent

Summary

Sends an event to the current element.

Method of dom/EventTargetdom/EventTarget

Syntax

var defaultPrevented = eventTarget.dispatchEvent(event);

Parameters

event

Data-type
String

The event object to dispatch.

Return Value

Returns an object of type BooleanBoolean

Whether any of the event handlers called preventDefault.

Default. The default action is permitted.

The caller should prevent the default action.

Notes

Events that the dispatchEvent method dispatches are subject to the same capturing and bubbling behavior as events that the browser dispatches. You cannot cancel some events. For more information, see the documentation for the event.

Related specifications

DOM Level 2 Events
Recommendation

Attributions