Skip to main content

XPathExpression

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

Methods

evaluate()

evaluate(
contextNode,
type?,
result?
): XPathResult;

The evaluate() method of the XPathExpression interface executes an XPath expression on the given node or document and returns an XPathResult.

MDN Reference

Parameters

ParameterType
contextNodeNode
type?number
result?XPathResult | null

Returns

XPathResult