Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

event.initUIEvent Redirect 1

« DOM Reference

Summary

Initializes a UI event once it's been created.

Syntax

event.initUIEvent(type, canBubble, cancelable, view, detail) 

Parameters

type
The type of event.
canBubble
A boolean indicating whether the event should bubble up through the event chain or not (see bubbles).
cancelable
A boolean indicating whether the event can be canceled (see cancelable).
view
The AbstractView associated with the event.
detail
A number specifying some detail information about the event, depending on the type of event. For mouse events, it indicates how many times the mouse has been clicked on a given screen location (usually 1).

Example

var e = document.createEvent("UIEvents");
// creates a click event that bubbles, can be cancelled,
// and with its view and detail property initialized to window and 1,
// respectively
e.initUIEvent("click", true, true, window, 1);

Specification

DOM Level 2 Events - method of UIEvent object

Document Tags and Contributors

 Last updated by: Sheppy,