Name
Element.dispatchEvent( ): dispatch a synthetic event to this node — DOM Level 2 Events:
Synopsis
boolean dispatchEvent(Eventevt)
throws EventException;Arguments
-
evt The Event object to be dispatched.
Returns
false if the preventDefault( ) method of
evt is called at any time during the
propagation of the event, or true otherwise.
Throws
This method throws an exception if the Event object
evt is not initialized, or if its
type property is null or the empty string.
Description
This method dispatches a synthetic event created with Document.createEvent( ) and initialized
with the initialization method defined by the Event interface or one
of its subinterfaces. The node on which this method is called
becomes the target of the event, but the event first propagates down
the document tree during the capturing phase, and then, if the
bubbles property of the event is
true, it bubbles up the document
tree after being handled at the event target itself.
See Also
Document.createEvent( ),
Event.initEvent( ), MouseEvent.initMouseEvent( )
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access