Skip to main content

HTMLCollectionBase

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

MDN Reference

Extended by​

Indexable​

[index: number]: Element

Methods​

[iterator]()​

iterator: ArrayIterator<Element>;

Returns​

ArrayIterator<Element>


item()​

item(index): Element | null;

The HTMLCollection method item() returns the element located at the specified offset into the collection.

MDN Reference

Parameters​

ParameterType
indexnumber

Returns​

Element | null

Properties​

length​

readonly length: number;

The HTMLCollection.length property returns the number of items in a HTMLCollection.

MDN Reference