282Part IIIDocument Objects ReferenceListing 15-25(continued) } // invoke (Web site developers)
282Part IIIDocument Objects ReferenceListing 15-25(continued) } // invoke fireEvent() on object whose ID is passed as parameterfunction doDispatch(objID, evt) { // create empty mouse eventvar newEvt = document.createEvent( MouseEvents ); // initialize as click with button ID 3newEvt.initMouseEvent( click , true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 3, null); // send event to element passed as paramdocument.getElementById(objID).dispatchEvent(newEvt); // don t let button clicks bubbleevt.stopPropagation(); }
fireEvent() Method
This is a paragraph (with a nested SPAN) that receives click events.
Control Panel