Home > Web Front-end > JS Tutorial > javascript 触发HTML元素绑定的函数_javascript技巧

javascript 触发HTML元素绑定的函数_javascript技巧

WBOY
Release: 2016-05-16 18:19:58
Original
900 people have browsed it
复制代码 代码如下:

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
}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template