11
28
2008
1

[JavaScript]程序触发点击事件

function doClick(obj){
    if (document.createEvent){//火狐写法
        var evObj = document.createEvent('MouseEvents');
        evObj.initEvent( 'click', true, false );
        obj.dispatchEvent(evObj);
    }else{//ie写法
        obj.click();
    }
}

ie比较简单,但不规范,火狐代码多一点,但是规规矩矩

但是似乎`

Category: JavaScript | Tags: javascript 鼠标点击 | Read Count: 2023
Avatar_small
johnson 说:
2018年11月15日 01:33

I am doing a project on this programming language. In https://resumeshelpservice.com/resumewriters-com-review/, I have downloaded many materials to learn more about this. I am really glad to get this site.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com