web api interface
NamedNodeMap
The NamedNodeMap interface represents a collection of Attr objects. Objects inside a NamedNodeMap are not in any particular order, unlike NodeList, although they may be accessed by an index as in an array.
A NamedNodeMap object is live and will thus be auto-updated if changes are made to its contents internally or elsewhere.
[!NOTE] Although called
NamedNodeMap, this interface doesn’t deal withNodeobjects but withAttrobjects, which are a specialized class ofNodeobjects.
Instance properties
This interface doesn’t inherit any property.
lengthRead only- : Returns the amount of objects in the map.
Instance methods
This interface doesn’t inherit any method.
getNamedItem()- : Returns an
Attr, corresponding to the given name.
- : Returns an
setNamedItem()- : Replaces, or adds, the
Attridentified in the map by the given name.
- : Replaces, or adds, the
removeNamedItem()- : Removes the
Attridentified by the given map.
- : Removes the
item()- : Returns the
Attrat the given index, ornullif the index is higher or equal to the number of nodes.
- : Returns the
getNamedItemNS()- : Returns an
Attridentified by a namespace and related local name.
- : Returns an
setNamedItemNS()- : Replaces, or adds, the
Attridentified in the map by the given namespace and related local name.
- : Replaces, or adds, the
removeNamedItemNS()- : Removes the
Attridentified by the given namespace and related local name.
- : Removes the
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.