A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/Document/createExpression below:

Document: createExpression() method - Web APIs

Document: createExpression() method

Baseline Widely available

This method compiles an XPathExpression which can then be used for (repeated) evaluations.

You must call this method on the same document that you run the expression against.

Syntax
createExpression(xpathText, namespaceURLMapper)
Parameters
xpathText

A string which is the XPath expression to be compiled.

namespaceURLMapper

A function which maps a namespace prefix to a namespace URL (or null if none needed).

Return value Examples
const xpathExpr = document.createExpression("//div");
const xpathResult = xpathExpr.evaluate(document); // returns an XPathResult object
const nodeContext = document.querySelector("nav");
// Re-using the XPathExpression "xpathExpr"
const otherResult = xpathExpr.evaluate(nodeContext); // returns an XPathResult object
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4