EventTarget: dispatchEvent() method - Web APIs | MDN
Syntax
Parameters
event-
The
Eventobject to dispatch. ItsEvent.targetproperty will be set to the currentEventTarget.
Return value
false if event is cancelable, and at least one of the event handlers which received event called Event.preventDefault(). Otherwise true.
Exceptions
InvalidStateErrorDomException-
Thrown if the event's type was not specified during event initialization.
Warning: Exceptions thrown by event handlers are reported as uncaught exceptions. The event handlers run on a nested callstack; they block the caller until they complete, but exceptions do not propagate to the caller.
Example
Specifications
| Specification |
|---|
| DOM # ref-for-dom-eventtarget-dispatcheventâ‘¢ |