javascript 触发HTML元素绑定的函数
发布时间:2016-12-30 来源:查字典编辑
摘要:复制代码代码如下:if(document.createEvent){varclickEvent=document.createEvent("...
复制代码 代码如下:
if (document.createEvent) {
var clickEvent = document.createEvent("MouseEvents");
clickEvent.initEvent("click", false, true);
this.fileEl.dom.dispatchEvent(clickEvent);//ff
} else if (document.createEventObject) {
this.fileEl.dom.fireEvent("onclick", document.createEventObject(e.browserEvent));//ie
}