For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

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.

MDN Reference

interface NamedNodeMap {
    length: number;
    "[iterator]"(): ArrayIterator<Attr>;
    getNamedItem(qualifiedName: string): Attr | null;
    getNamedItemNS(namespace: string | null, localName: string): Attr | null;
    item(index: number): Attr | null;
    removeNamedItem(qualifiedName: string): Attr;
    removeNamedItemNS(namespace: string | null, localName: string): Attr;
    setNamedItem(attr: Attr): Attr | null;
    setNamedItemNS(attr: Attr): Attr | null;
    [index: number]: Attr;
}

Indexable

  • [index: number]: Attr
Index
length: number

The read-only length property of the NamedNodeMap interface is the number of objects stored in the map.

MDN Reference

  • The getNamedItem() method of the NamedNodeMap interface returns the Attr corresponding to the given name, or null if there is no corresponding attribute.

    MDN Reference

    Parameters

    • qualifiedName: string

    Returns Attr | null

  • The getNamedItemNS() method of the NamedNodeMap interface returns the Attr corresponding to the given local name in the given namespace, or null if there is no corresponding attribute.

    MDN Reference

    Parameters

    • namespace: string | null
    • localName: string

    Returns Attr | null

  • The item() method of the NamedNodeMap interface returns the item in the map matching the index.

    MDN Reference

    Parameters

    • index: number

    Returns Attr | null

  • The removeNamedItem() method of the NamedNodeMap interface removes the Attr corresponding to the given name from the map.

    MDN Reference

    Parameters

    • qualifiedName: string

    Returns Attr

  • The removeNamedItemNS() method of the NamedNodeMap interface removes the Attr corresponding to the given namespace and local name from the map.

    MDN Reference

    Parameters

    • namespace: string | null
    • localName: string

    Returns Attr

  • The setNamedItem() method of the NamedNodeMap interface puts the Attr identified by its name in the map. If there is already an Attr with the same name in the map, it is replaced.

    MDN Reference

    Parameters

    Returns Attr | null

  • The setNamedItemNS() method of the NamedNodeMap interface puts the Attr identified by its name in the map. If there was already an Attr with the same name in the map, it is replaced.

    MDN Reference

    Parameters

    Returns Attr | null

Was this helpful?