Chrome, Firfox does not support the FireEvent method
You can use the Dispatchevent method instead of directly giving a compatible code.
Triggers the Click event
Copy Code code as follows:
function Simulateclick (EL) {
var evt;
if (document.createevent) {//DOM Level 2 standard
EVT = Document.createevent ("mouseevents");
Evt.initmouseevent ("Click", True, true, window,
0, 0, 0, 0, 0, False, False, False, FALSE, 0, NULL);
El.dispatchevent (EVT);
else if (el.fireevent) {//IE
El.fireevent (' onclick ');
}
}
Trigger Drag Event
Copy Code code as follows:
function Simulatedrag (EL) {
var evt;
if (document.createevent) {//DOM Level 2 standard
EVT = document.createevent ("MouseEvent");
Evt.initmouseevent ("DragStart", True, true, window,
0, 0, 0, 0, 0, False, False, False, FALSE, 0, NULL);
El.dispatchevent (EVT);
} else if (el.fireevent) {//IE
El.fireevent (' ondragstart ');
}
}