Deprecated
This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Creates a new event, which must then be initialized by calling its initEvent() method.

Do not use this method anymore as it is deprecated.

Instead use specific event constructors, like Event(). The page on Creating and triggering events gives more information about the way to use these.

Syntax

document.createEvent(type) 
type
A string indicating the event type to create.

This method returns a new DOM Event object of the specified type, which must be initialized before use.

Example

var newEvent = document.createEvent("UIEvents");

Specification

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support No ? ? ? No ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support No No ? ? No ? ?

See also

Document Tags and Contributors

Contributors to this page: urty5656, fscholz, vrana, teoli, kscarfone, Cobra, Sheppy, Matej Lednar
Last updated by: urty5656,