JavaScript and DOM
R&D 04: DOM: Custom Events




About Custom Events

Summary

Custom events allow for customizable user-defined actions created using JavaScript; these custom events can interact with the DOM.


How to Create a Custom Event

Summary

To create a custom event, use the CustomEvent() constructor with the following syntax:

new CustomEvent(type);

Why Custom Events Are Used

Summary

Custom events are used to ease communication between the DOM and any attached scripts.


Grand Summary

This R&D page contains information about the following topics:

  • CustomEvent Interface
  • CustomEvent() Constructor