Open midenok opened 7 years ago
function getElementByXpath(path) {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
console.log( getElementByXpath("//ul[@class=\"changes\"]") );
true;
function getElementsByXpath(path)
{
return document.evaluate(path, document, null, XPathResult.ANY_TYPE, null);
}
var it = getElementsByXpath("//ul[@class=\"changes\"][not(parent::*/@data-content)]/../..");
var n;
while (n = it.iterateNext()) {
n.style.display = "none";
console.log(n);
}
true;