Javascript Reference
Categories: document

javascript document createEventObject( )

@March 15, 2008, 1:22 a.m.
createEventObject( ) Firefox/Netscape/NN n/a IE 5.5(Win) Chrome/Safari/DOM n/a

createEventObject([existingEventObject])

Generates in memory an instance of an empty IE DOM event object. After the generic event is created, its properties can be stuffed with pertinent values to help the event be processed. Then the event acts as a parameter to an element's fireEvent( ) method, at which point the event type is associated with the event. The following sequence creates a mousedown event and sends it to an element:

var evt = document.createEventObject( );
document.getElementById("myElement").fireEvent("onmousedown", evt);
 

You can also use an existing event object as a model for a script-generated event. Pass the current event object as a parameter to the createEventObject( ) method, and modify the properties of the new object as you see fit.

 
Parameters
 
existingEventObject

Reference to an event object either generated by the user or script. The new event assumes all properties of the existing event object.

 
Returned Value

event object reference.

It will be error. And it is IE only.
javascript reference - 2010-02-09
what will happend if evt is null in fireEvent function?
Знание - 2010-02-09

Powered by Linode.