The createEvent() method in HTML creates an event object of the specified type. The created event must be initialized before use.
document.createEvent( event_type )
event_type: It is the required parameter and used to specify the type of event.
There are many type of events which are listed below:
Below program illustrates the createEvent() method in HTML:
Before Click on the element:
After Click on the element:
Supported Browsers: The browser supported by DOM createEvent() method are listed below:
- Google Chrome
- Internet Explorer
- HTML | DOM stopPropagation() Event Method
- HTML | DOM onsuspend Event
- HTML | DOM onmessage Event
- HTML | DOM onopen Event
- HTML | DOM onwaiting event
- HTML | DOM onunload Event
- HTML | DOM onwheel Event
- HTML | DOM animationstart Event
- HTML | DOM onpaste Event
- HTML | DOM animationiteration Event
- HTML | DOM touchmove Event
- HTML | DOM touchcancel Event
- HTML | DOM Storage Event
- HTML | DOM onerror Event
- HTML | DOM onended Event
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.