CustomEvent

CustomEvent works analogously to the constructor for Event except that the eventInitDict argument now allows for setting the detail attribute too.

Syntax

event = new CustomEvent(type [, eventInitDict])

Parameters

type

The type of event.

eventInitDict

Allows setting the bubbles, cancelable, composed, and detail attributes.

Examples

1

2

3

4

5

6

7

Internal

detail

External

Web Hypertext Application Technology Working Group (WHATWG)

Home Menu