VOOZH about

URL: https://www.geeksforgeeks.org/javascript/html-dom-createevent-event-method/

⇱ HTML DOM createEvent() Event Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML DOM createEvent() Event Method

Last Updated : 11 Jul, 2025

The createEvent() method in HTML creates an event object of the specified type. The created event must be initialized before use. 

Syntax:

document.createEvent(event_type)

event_type: It is the required parameter and is used to specify the type of event. There are many types of events which are listed below:

Example: Below program illustrates the createEvent() method in HTML.

Output:

👁 Image

Supported Browsers: The browser supported by DOM createEvent() method are listed below:

Comment
Article Tags:
Article Tags: