可乐博客

关于js触发事件的写法

var fireOnThis = $x('/html/body/div[1]/div[2]/div[2]/div[3]/div[1]/div/div[2]/div/div[2]/div')[0];
var e = document.createEvent("MouseEvents");
e.initEvent("mouseover", true, true);             
fireOnThis.dispatchEvent(e);      
fireOnThis.click();

选择器自备,可以是jq

随笔