DOM - NodeList 物件



NodeList 物件指定有序節點集合的抽象。可以用從 0 開始的數字索引訪問 NodeList 中的項。

屬性

下表列出了 NodeList 物件的屬性 -

屬性 型別 描述
length unsigned long 它給出節點列表中的節點數。

方法

以下是 NodeList 物件的唯一方法。

序號 方法和描述
1 item()

它返回集合中index第項。如果索引大於或等於列表中的節點數,則返回 null。

廣告
© . All rights reserved.