Initializes a new generic event that the createEvent method created.
Syntax event.initEvent(eventType, canBubble, cancelable);
Parameters eventType
The name of the event. Sets the value for the type property.
canBubbleWhether the event propagates upward. Sets the value for the bubbles property.
cancelableWhether the event is cancelable and so preventDefault can be called. Sets the value for the cancelable property.
Return ValueNo return value
ExamplesThe following code example creates a custom event that bubbles but cannot be canceled.
var evt = document.createEvent("Event");
evt.initEvent("custom", true, false);
document.getElementById('target').dispatchEvent(evt);
Usage
Use this method before the dispatchEvent method dispatches the event object, to set some properties of the event.
Notes
After the event is dispatched, its properties cannot be changed.
Related specificationsMicrosoft Developer Network: [Windows Internet Explorer API reference Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4