For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Interface XPathExpression
interface XPathExpression {
evaluate(
contextNode: Node,
type?: number,
result?: XPathResult | null,
): XPathResult;
}
evaluate(
contextNode: Node,
type?: number,
result?: XPathResult | null,
): XPathResult;
}
Methods
evaluate
-
The
evaluate()method of the XPathExpression interface executes an XPath expression on the given node or document and returns an XPathResult.Parameters
- contextNode: Node
Optionaltype: numberOptionalresult: XPathResult | null
Returns XPathResult
This interface is a compiled XPath expression that can be evaluated on a document or specific node to return information from its DOM tree.
MDN Reference