Name

Node.selectNodes( ): select nodes with an XPath query — IE 6

Synopsis

NodeList selectNodes(Stringquery)

Arguments

query

The XPath query string.

Returns

A single Node that matches the query, or null if there are none.

Description

This IE-specific method evaluates an XPath expression using this node as the context node. It returns the first matching node found, or null if no nodes match. The selectSingleNode( ) method exists only on the nodes of XML documents, not HTML documents. Note that since Document objects are themselves nodes, this method can be applied to entire XML documents.

For a cross-browser alternative, see Document.evaluate( ).

See Also

Document.evaluate( ), XPathExpression; Chapter 21

Get JavaScript: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.