The dispatchEvent method allows the dispatch of events into the implementation's event model.
Syntaxboolean = element.dispatchEvent(event)
event is an event object that contains information about the type, behavior, and contextual information of the event to be dispatched.
When you create and dispatch an event using this method, the event has the same effect as events dispatched by user interaction. They are "real" events, in other words, and they bubble up the UI in the same way. See the event object interface for more information about the information that is passed in with this method.