XPathExpression

An XPathExpression is a compiled XPath query returned from document.createExpression(). It has a method evaluate() which can be used to execute the compiled XPath.

Methods

XPathExpression.evaluate()
provide a context node/document, XPathResult constant, and XPathResult to store the query or null to return a new XPathResult.
XPathExpression.evaluateWithContext()
provide a context node/document, context position, context size, XPathResult constant, and XPathResult to store the query or null to return a new XPathResult.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge ? Firefox Full support YesIE ? Opera Full support YesSafari ? WebView Android ? Chrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
evaluateChrome Full support YesEdge ? Firefox Full support YesIE ? Opera Full support YesSafari ? WebView Android ? Chrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

Contributors to this page: ExE-Boss, fscholz, Jeremie, BlindWanderer, Brettz9
Last updated by: ExE-Boss,