Latest web development tutorials

XML DOM - NamedNodeMap objects

NamedNodeMap unordered list object represents a node.


NamedNodeMap objects

NamedNodeMap The nodes can be accessed through their names.

NamedNodeMap will update itself. If you delete or add an element in the node list or the XML document, the list will be updated automatically.

Note: In the name node graph, the nodes are not returned in any particular order.

NamedNodeMap object properties

属性 描述
length 返回列表中节点的数量。

NamedNodeMap object methods

方法 描述
getNamedItem() 返回指定的节点(通过名称)。
getNamedItemNS() 返回指定的节点(通过名称和命名空间)。
item() 返回指定索引号的节点。
removeNamedItem() 删除指定的节点(通过名称)。
removeNamedItemNS() 删除指定的节点(通过名称和命名空间)。
setNamedItem() 设置指定的节点(通过名称)。
setNamedItemNS() 设置指定的节点(通过名称和命名空间)。