Event.createEvent()
Creates a new event, which must then be initialized by calling its init()
method.
Syntax
JavaScript
Copy Code
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
Copy Code
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