【发布时间】:2013-03-26 00:38:56
【问题描述】:
【问题讨论】:
标签: dom nodelist htmlcollection
【问题讨论】:
标签: dom nodelist htmlcollection
如您所说,NodeList 定义在 DOM-Level-3-Core 中,HTMLCollection 定义在 DOM-Level-2-HTML 中。
他们的接口是:
interface HTMLCollection {
readonly attribute unsigned long length;
Node item(in unsigned long index);
Node namedItem(in DOMString name);
};
interface NodeList {
Node item(in unsigned long index);
readonly attribute unsigned long length;
};
所以 NodeList 是 HTMLCollection 的继承者,以更通用的形式(对于 xml)。