Custom events are events that we create ourselves when we want to separate codes that fire and listen for events. Custom events can be very helpful in changing things without breaking the code.
To create custom events we use a function called CustomEvent(). The CustomEvent() has 2 parameters:
We use custom events when we want to separate the code after completeing another piece of code. For example we can seperate event listeners in a separate script and have many event listeners to the same custom event.
Thus, custom events are a very helpful tool that let your page be more interactive. The difference between standard events and custom events is that regular events only have 9 default labels and cannot be renamed while custom events can be named anything and are easier to setup.