const xpathResult = document.evaluate( xpathExpression, contextNode, namespaceResolver, resultType, result, ); The evaluate() method takes a total of five parameters: xpathExpression: A string containing the XPath expression to be evaluated. contextNode: A node in the document against which the xpathExpression should be evaluated, including any and all of its child nodes. The document node is the
![Introduction to using XPath in JavaScript - XPath | MDN](https://cdn-ak-scissors.b.st-hatena.com/image/square/aa767575b4232d312d2c5de428f0bf0955805e26/height=288;version=1;width=512/https%3A%2F%2Fdeveloper.mozilla.org%2Fmdn-social-share.cd6c4a5a.png)