NamedNodeMap

  • Revision slug: DOM/NamedNodeMap
  • Revision title: NamedNodeMap
  • Revision id: 139792
  • Created:
  • Creator: Brettz9
  • Is current revision? No
  • Comment 24 words added

Revision Content

A collection of nodes returned by Element.attributes (also potentially for DocumentType.entities, DocumentType.notations). NamedNodeMaps are not in any particular order (unlike NodeList), although they may be accessed by an index as in an array (they may also be accessed with the item() method). A NamedNodeMap object are live and will thus auto-updated if changes are made to their contents internally or elsewhere.

Properties

length (read-only integer)

Methods

Method Action Return
getNamedItem ( nameStr ) Gets a node by name Node
setNamedItem (node ) Adds (or replaces) a node by its nodeName Node
removeNamedItem ( nameStr ) Removes a node (or if an attribute, may reveal a default if present) Node
item ( idx ) Returns the item at the given index (or null if the index is higher or equal to the number of nodes) Node
getNamedItemNS ( namespaceURI , localName ) Gets a node by namespace and localName Node
setNamedItemNS ( node ) Adds (or replaces) a node by its localName and namespaceURI Node
removeNamedItemNS ( namespaceURI , localName ) Removes a node (or if an attribute, may reveal a default if present) Node

Specification

Revision Source

<p>A collection of nodes returned by <a class="internal" href="/En/DOM/Node.attributes" title="En/DOM/Element.attributes"><code>Element.attributes</code></a> (also potentially for <code><a class="internal" href="/En/DOM/DocumentType.entities" title="En/DOM/DocumentType.entities">DocumentType.entities</a></code>, <code><a class="internal" href="/En/DOM/DocumentType.notations" title="En/DOM/DocumentType.notations">DocumentType.notations</a></code>). <code>NamedNodeMap</code>s are not in any particular order (unlike <code><a class="internal" href="/En/DOM/NodeList" title="En/DOM/NodeList">NodeList</a></code>), although they may be accessed by an index as in an array (they may also be accessed with the <code>item</code>() method). A NamedNodeMap object are live and will thus auto-updated if changes are made to their contents internally or elsewhere.</p>
<h3>Properties</h3>
<p><a class="internal" href="/En/DOM/NamedNodeMap.length" title="En/DOM/NamedNodeMap.length">length</a> (read-only integer)</p>
<h3>Methods</h3>
<table border="1" cellpadding="1" cellspacing="1" style="width: 588px; height: 196px;"> <tbody> <tr> <td>Method</td> <td>Action</td> <td>Return</td> </tr> <tr> <td><code>getNamedItem</code> ( <code>nameStr</code> )</td> <td>Gets a node by name</td> <td><code><a class="internal" href="/en/DOM/Node" title="En/DOM/Node">Node</a></code></td> </tr> <tr> <td><code>setNamedItem</code> (<code>node</code> )</td> <td>Adds (or replaces) a node by its nodeName</td> <td><code><a class="internal" href="/en/DOM/Node" title="En/DOM/Node">Node</a></code></td> </tr> <tr> <td><code>removeNamedItem</code> ( <code>nameStr</code> )</td> <td>Removes a node (or if an attribute, may reveal a default if present)</td> <td><code><a class="internal" href="/en/DOM/Node" title="En/DOM/Node">Node</a></code></td> </tr> <tr> <td><code>item</code> ( <code>idx</code> )</td> <td>Returns the item at the given index (or null if the index is higher or equal to the number of nodes)</td> <td><code><a class="internal" href="/en/DOM/Node" title="En/DOM/Node">Node</a></code></td> </tr> <tr> <td><code>getNamedItemNS</code> ( <code>namespaceURI , localName</code> )</td> <td>Gets a node by namespace and localName</td> <td><code><a class="internal" href="/en/DOM/Node" title="En/DOM/Node">Node</a></code></td> </tr> <tr> <td><code>setNamedItemNS</code> ( <code>node</code> )</td> <td>Adds (or replaces) a node by its localName and namespaceURI</td> <td><code><a class="internal" href="/en/DOM/Node" title="En/DOM/Node">Node</a></code></td> </tr> <tr> <td><code>removeNamedItemNS</code> ( <code>namespaceURI , localName</code> )</td> <td>Removes a node (or if an attribute, may reveal a default if present)</td> <td><code><a class="internal" href="/en/DOM/Node" title="En/DOM/Node">Node</a></code></td> </tr> </tbody>
</table>
<h3>Specification</h3>
<ul> <li><a class=" external" href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1780488922" rel="freelink">http://www.w3.org/TR/DOM-Level-3-Cor...#ID-1780488922</a></li>
</ul>
Revert to this revision