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 HTMLCollectionOf<T> {
    length: number;
    item(index: number): null | T;
    namedItem(name: string): null | T;
    [index: number]: T;
}

类型参数

层级 (查看完整内容)

可索引

  • [index: number]: T

属性

方法

属性

length: number

Sets or retrieves the number of objects in a collection.

方法

  • Retrieves an object from various collections.

    参数

    • index: number

    返回 null | T

  • 参数

    • name: string

    返回 null | T