如何使用xPath添加jQuery点击事件?
这个问题在这里已经有了答案:
这可能会帮助你。
stackoverflow链接
function _x(STR_XPATH) {
var xresult = document.evaluate(STR_XPATH, document, null, XPathResult.ANY_TYPE, null);
var xnodes = [];
var xres;
while (xres = xresult.iterateNext()) {
xnodes.push(xres);
}
return xnodes;
}
$(_x('//div[@id="slideit"]/a[contains(@href, "javaScript:void(0)")]/..//following-sibling::div[1]')).css({
'color': 'red'
});
链接地址: http://www.djcxy.com/p/14719.html
上一篇: how to add jQuery click event using xPath?
下一篇: Check if click occured inside or outside of modal window