NamedNodeMap
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
NamedNodeMap 介面表示了 Attr 物件的集合。雖然 NamedNodeMap 與 NodeList 都能如陣列一般透過索引訪問成員,但和 NodeList 不同的是,NamedNodeMap 中的成員並沒有順序。
NamedNodeMap 物件具有即時性(live),如果其內部成員(屬性節點物件)發生改變,NamedNodeMap 物件會自動更新至最新的狀態。
屬性
This interface doesn't inherit any property.
NamedNodeMap.lengthRead only-
Returns the amount of objects in the map.
方法
This interface doesn't inherit any method.
NamedNodeMap.getNamedItem()-
Returns a
Attr, corresponding to the given name. NamedNodeMap.setNamedItem()-
Replaces, or adds, the
Attridentified in the map by the given name. NamedNodeMap.removeNamedItem()-
Removes the
Attridentified by the given map. NamedNodeMap.item()-
Returns the
Attrat the given index, ornullif the index is higher or equal to the number of nodes. NamedNodeMap.getNamedItemNS()-
Returns a
Attridentified by a namespace and related local name. NamedNodeMap.setNamedItemNS()-
Replaces, or adds, the
Attridentified in the map by the given namespace and related local name. NamedNodeMap.removeNamedItemNS()-
Removes the
Attridentified by the given namespace and related local name.
規範
| Specification |
|---|
| DOM> # interface-namednodemap> |
瀏覽器相容性
Loading…