This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

initUIEvent

Summary

Initializes a new user interface event that the createEvent method created.

Method of dom/UIEventdom/UIEvent

Syntax

 event.initUIEvent(/* see parameter list */);

Parameters

eventType

Data-type
String

The name of the event. Sets the value for the type property. valid values are:

abort - An onabort event. error - An onerror event. load - An onload event. select - An onselect event. resize - An onresize event.

canBubble

Data-type
Boolean

Whether the event propagates upward. Sets the value for the bubbles property.

cancelable

Data-type
Boolean

Whether the event is cancelable and so preventDefault can be called. Sets the value for the cancelable property.

view

Data-type
DOM Node

The window on which this event is occurring. Sets the value for the view property.

detail

Data-type
Number

Specifies additional information. This value is returned in the detail property of the event.

Return Value

No return value

Examples

var evt = 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
evt.initUIEvent("click", true, true, window, 1);

Related specifications

DOM Level 3 Events
Working Draft

Attributions