DOM NodeList对象

NodeList对象指定有序节点集合的抽象。 NodeList中的项目可通过整数索引访问,它的索引从0开始。

1. 属性

下表列出了NodeList对象的属性 -

属性 类型 描述
length unsigned long 它给出了节点列表中的节点数。

2. 方法

以下是NodeList对象的唯一方法。

序号 方法 描述
1 item() 它返回集合中的索引项。 如果索引大于或等于列表中的节点数,则返回null