Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
go
Expand Minimize

getElementsByTagNameNS method

Gets a collection of nodes that match an element name from the specified namespace.

Document Object Model (DOM) Level 3 Core Specification, Section 1.4Internet Explorer 9

 

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

document

 

 

Show:
© 2015 Microsoft