TOC PREV NEXT INDEX

domref



dispatchEvent


The dispatchEvent method allows the dispatch of events into the implementation's event model.

Syntax

boolean = element.dispatchEvent(event)
 

Parameters

event is an event object that contains information about the type, behavior, and contextual information of the event to be dispatched.

Example

b = document.getElementById("button1");
 
res = b.dispatchEvent("click");
 
if ( res ) {
 
   // event dispatch was successful
 
   b.disabled = true;
 
}
 

Notes

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.

Specification

dispatchEvent
 


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX