📜  DOM-NamedNodeMap对象

📅  最后修改于: 2020-11-10 05:11:55             🧑  作者: Mango


NamedNodeMap对象用于表示可以通过名称访问的节点的集合。

属性

下表列出了NamedNodeMap对象的属性。

Attribute Type Description
length unsigned long It gives the number of nodes in this map. The range of valid child node indices is 0 to length-1 inclusive.

方法

下表列出了NamedNodeMap对象的方法。

S.No. Methods & Description
1 getNamedItem ()

Retrieves the node specified by name.

2 getNamedItemNS ()

Retrieves a node specified by local name and namespace URI.

3 item ()

Returns the indexth item in the map. If index is greater than or equal to the number of nodes in this map, this returns null.

4 removeNamedItem ()

Removes a node specified by name.

5 removeNamedItemNS ()

Removes a node specified by local name and namespace URI.

6 setNamedItem ()

Adds a node using its nodeName attribute. If a node with that name is already present in this map, it is replaced by the new one.

7 setNamedItemNS ()

Adds a node using its namespaceURI and localName. If a node with that namespace URI and that local name is already present in this map, it is replaced by the new one. Replacing a node by itself has no effect.