function emitClick(querySelector) {
let e = document.createEvent("MouseEvents");
e.initEvent("click", true, true);
document.querySelector(querySelector).dispatchEvent(e);
}
function emitClick(querySelector) {
let e = document.createEvent("MouseEvents");
e.initEvent("click", true, true);
document.querySelector(querySelector).dispatchEvent(e);
}
本文标题:js 主动触发点击事件
本文链接:https://www.haomeiwen.com/subject/lkxygltx.html
网友评论