getElementsByTagNameNS method
Gets a collection of nodes that match an element name from the specified namespace.
![]() ![]() |
Syntax
var pelColl = document.getElementsByTagNameNS(pvarNS, bstrLocalName);Parameters
- pvarNS [in]
-
Type: Variant
A String value that contains the name of the desired namespace.
- bstrLocalName [in]
-
Type: BSTR
A String value that contains the name of the element or an asterisk (
*) to return all elements within the namespace. - pelColl [out, retval]
-
Type: IHTMLElementCollection
A reference to an elements collection that lists nodes that match the specified name.
Return value
Type: IHTMLElementCollection
A reference to an elements collection that lists nodes that match the specified name.
Standards information
Examples
The following code example returns a collection of elements from the SVG namespace. In the context of a document, it returns a collection of SVG elements in the webpage.
var sNamespace = "http://www.w3.org/2000/svg"; var cElements = document.getElementsByTagNameNS( sNamespace, "*" );
See also
Show:

