A generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list.

interface HTMLCollection {
    length: number;
    item(index: number): null | Element;
    namedItem(name: string): null | Element;
}

层级 (查看完整内容)

属性

方法

属性

length: number

Sets or retrieves the number of objects in a collection.

方法

  • Retrieves a select object or an object from an options collection.

    参数

    • name: string

    返回 null | Element