For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages
are available by appending .md to any URL.
Interface HTMLCollectionOf<T>
interface HTMLCollectionOf<T extends Element> {
length: number;
"[iterator]"(): ArrayIterator<T>;
item(index: number): T | null;
namedItem(name: string): T | null;
[index: number]: T;
}
length: number;
"[iterator]"(): ArrayIterator<T>;
item(index: number): T | null;
namedItem(name: string): T | null;
[index: number]: T;
}
Type Parameters
- T extends Element
Hierarchy (View Summary)
- HTMLCollectionBase
- HTMLCollectionOf
Indexable
Properties
Readonlylength
length: number
The HTMLCollection.length property returns the number of items in a HTMLCollection.
Methods
[iterator]
-
Returns ArrayIterator<T>
item
-
The HTMLCollection method
item()returns the element located at the specified offset into the collection.Parameters
- index: number
Returns T | null
namedItem
-
Parameters
- name: string
Returns T | null
The
HTMLCollectioninterface 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