NamedNodeMap

Did you know that you can read content offline by using one of these tools? If you would like to read offline MDN content in another format, let us know by commenting on Bug 665750.

Dash App

Table of Contents

  1. Properties
  2. Methods
  3. Specification

Non-standard

Gecko 22 note
(Firefox 22 / Thunderbird 22 / SeaMonkey 2.19)

This interface has been renamed to prefixed MozNamedAttrMap, as it has been removed from the spec and only available for Node.attributes. (bugĀ 847195)

A collection of nodes returned by Node.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 be auto-updated if changes are made to their contents internally or elsewhere.

Properties

NamedNodeMap.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 namespaceURI 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

Tags (1)