XML DOM initEvent() Method
Definition and Usage
The initEvent() method initializes the properties of the new event object.
Syntax
event.initEvent(eventType,canBubble,cancelable)
Parameters | Description |
---|---|
eventType | String value. The type of the event. |
canBubble | Whether the event bubbles. |
cancelable | Whether preventDefault() method can cancel the event. |
Description
This method initializes Document.createEvent() Method created composite Event object's type attribute, bubbles attribute, and cancelable attribute. Only when the newly created Event object is Document Object or Element Object of dispatchEvent() Method Before dispatching, you can call the Event.initEvent() method.