DOM

DOM

Source

CustomEvent

In all current engines.

Firefox6+Safari5.1+Chrome15+ Opera11+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android6+iOS Safari6+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile11+

CustomEvent/CustomEvent

In all current engines.

Firefox11+Safari6.1+Chrome15+ Opera11.6+Edge79+ Edge (Legacy)12+IENone Firefox for Android14+iOS Safari6.1+Chrome for Android18+Android WebView37+Samsung Internet1.0+Opera Mobile12+


[Exposed=(Window,Worker)]
interface CustomEvent : , optional  = {}); readonly attribute , optional  = false, optional  = false, optional  = null); // legacy
}; dictionary CustomEventInit :  = null;
};

Events using the CustomEvent interface can be used to carry custom data.

event = new CustomEvent(type [, eventInitDict]) Works analogously to the constructor for Event except that the eventInitDict argument now allows for setting the detail attribute too. event . detail Returns any custom data event was created with. Typically used for synthetic events.

CustomEvent/detail

In all current engines.

Firefox11+Safari6.1+Chrome15+ Opera11.6+Edge79+ Edge (Legacy)12+IENone Firefox for Android14+iOS Safari6.1+Chrome for AndroidYesAndroid WebView37+Samsung InternetYesOpera MobileYes

The detail attribute must return the value it
was initialized to.

The initCustomEvent(type, bubbles, cancelable, detail) method steps are:

Specifications may define event constructing steps for all or some events. The algorithm is passed an event as indicated in the inner event creation steps.



Read Next page

Report Page