Name

Element.getElementsByTagNameNS( ): return descendant elements with the specified name and namespace — DOM Level 2 Core:

Synopsis

Node[] getElementsByTagNameNS(StringnamespaceURI,
                              String localName);

Arguments

namespaceURI

The URI that uniquely identifies the namespace of the element.

localName

The identifier that specifies the name of the element within its namespace.

Returns

A read-only array (technically, a NodeList) of Element objects that are descendants of this element and have the specified name and namespace.

Description

This method works like getElementsByTagName( ), except that the tag name of the desired elements is specified as a combination of a namespace URI and a local name defined within that namespace. This method is useful only with XML documents that use namespaces.

See Also

Document.getElementsByTagNameNS( ), Element.getElementsByTagName( )

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.