问题描述
有人可以告诉我,为IE 8浏览器替换它的方式是什么?谢谢!
我需要模拟鼠标点击特定元素,
以下代码都在IE9和firefox中工作,但是IE8可以' t支持document.createEvent,那么我可以使用其他任何方法吗?
var evt1 = document.createEvent(" MouseEvents");
                   evt1.initMouseEvent(QUOT;按一下[;,真,真实的,窗口,
             &NBSP ; 0,0,0,0,0,false,false,false,false,0,null);
document.activeElement.dispatchEvent(evt1 );
Is any one can tell me what is the way that can I replace it for IE 8 browser ? thanks!
I need to simulate mouse click on the specific element,
the below code are all working in IE9 and firefox, but IE8 can't support document.createEvent, So Is there any other method I can use ?
var evt1 = document.createEvent("MouseEvents");
evt1.initMouseEvent("click", true, true, window,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
document.activeElement.dispatchEvent(evt1);
这篇关于document.createEvent(" MouseEvents")适用于IE9和Firefox,但不能用于IE8!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!