Bada
Bada's Coding

Bada's Coding

Making Own Events

Bada's photo
Bada
·Sep 24, 2022·

1 min read

Table of contents

  • Event() - Basic
  • Event() - Options
  • CustomEvent() - 'detail'

Event() - Basic

We can make our own event using Event() constructor.

We can make the event happen by using 'dispatchEvent()'.

Event() - Options

We can set options such as 'bubbles', 'cancelable' or 'composed'.

In this section, I will cover 'bubbles'.

CustomEvent() - 'detail'

Using CustomEvent() constructor, we can send information using 'detail'.

It is useful when something changes by events and it cannot be accessed by somewhere outside.

|information of other events|

|information in other modules|

 
Share this