ZVON > References > DOM2 Reference

getElementsByTagNameNS (method )

Owning interface and usage:  
Document.getElementsByTagNameNS(namespaceURI, localName)

Member of these other interfaces:  
none

Description:  
Returns a NodeList containing all Elements of the given local name and namespace URI in the same order as they appear in the source document.

Parameters:  
DOMString namespaceURI  -  The namespace URI of the elements to match on. The special value "*" matches all namespaces.
DOMString localName  -  The local name of the elements to match on. The special value "*" matches all local names.

Returns:  
NodeList -  A new NodeList object containing all the matched Elements.

Exceptions:  
none


Example:
Text in the first DIV.
x a b x
Text in the last DIV.
Source:
   <div id="doc" xmlns:svg="http://www.w3.org/2000/svg">
     <div>
       Text in the first DIV.
     </div>
     <svg:svg id="logo" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="60">
       <svg:g style="fill:#3399cc; font-size:36pt; font-family:'dialog'; font-weight: bold">
         <svg:a xlink:type="simple" xlink:href="http://www.zvon.org">
           <svg:text x="50%" y="65%" text-anchor="middle">ZVON.org</svg:text>
         </svg:a>
       </svg:g>
     </svg:svg>
     <apply xmlns="http://www.w3.org/1998/Math/MathML">
   <int/> 
   <bvar> 
     <ci> x </ci> 
   </bvar> 
   <interval> 
     <ci> a </ci> 
     <ci> b </ci> 
   </interval> 
   <apply>
     <cos/> 
     <ci> x </ci> 
   </apply> 
     </apply> 
     <div>
       Text in the last DIV.
     </div>
   </div>
     
JavaScript:
  var main = document.getElementsByTagNameNS('http://www.w3.org/1998/Math/MathML', 'apply');
  var output = main.length;
Output:
desired your browser
2