4R - DOM Custom Events

DOM Custom Events

In Javascript there are events running all of the time. Custom events are events that developers create to do something when a user opens a page, clicks, hovers, etc. In our assignment we made an event that built an image on the page when a link was clicked.

How to Create Custom Events

The MDN provides syntax for creating custom events. The parameters are type, options, and detail. Here is a link to a helpful page.

Why DOM Custom Events Are Used

Custom events are used to make a page interactive. It makes browsing a better experience for the user.

Summary

Cusom events can be used for all kinds of actions the developer wants to perform and they help the user on the page.