Event.createEvent()

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

Syntax

JavaScript
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

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

Specification

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/event/createevent

API DOM Event Method