Event.initEvent() (Method)

An Event object initializer that must be called before dispatching the Event object to an EventTarget.

Availability:

DOM level - 2
JavaScript - 1.5
Netscape - 6.0
JavaScript syntax:NmyEvent.initEvent(aType, aBubble, aCancel)
Argument list:aTypeA string indicating the event type
aBubbleA boolean flag indicating whether the event can bubble
aCancelA boolean flag indicating whether the event can be cancelled

This method is used to initialize Event objects that have been created with the DocumentEvent object. It is intended that this be called at the outset although the DOM level 2 specification allows for an implementation to call it several times later on if necessary.

The event type argument value must conform to the conventions discussed in the Event.type topic.

The first of the remaining arguments is a flag value to indicate whether the event is bubbling or capturing in its behavior. The last argument is a flag to indicate whether the event can be cancelled.

See also:Event.type