For example in javascript using getelementbyid:
document.getElementById("theID").style.width="100%";
can i change the css from the node retrieved by xpath like with getelementbyid?
For example in javascript using getelementbyid:
document.getElementById("theID").style.width="100%";
can i change the css from the node retrieved by xpath like with getelementbyid?
Yes, i did it like this:
var xpath = 'your xpath';
var matchingElement = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
matchingElement.style.color = "blue";
xpath= $x('//body'); // this will return an array usually containing 1 element
xpath[0].classList.value=""; // edit class name
xpath[0].style.display="none"; // edit style attributes
useful links I found: https://devhints.io/xpath#class-check