Interface HTMLCollection
interface HTMLCollection {
length: number;
"[iterator]"(): ArrayIterator<Element>;
item(index: number): Element | null;
namedItem(name: string): Element | null;
[index: number]: Element;
}
length: number;
"[iterator]"(): ArrayIterator<Element>;
item(index: number): Element | null;
namedItem(name: string): Element | null;
[index: number]: Element;
}
Hierarchy
- HTMLCollectionBase
- HTMLCollection
Indexable
Index
Properties
Methods
Methods
[iterator]
Returns ArrayIterator<Element>
item
The HTMLCollection method
item()returns the element located at the specified offset into the collection.Parameters
- index: number
Returns Element | null
namedItem
The
namedItem()method of the HTMLCollection interface returns the first Element in the collection whoseidornameattribute match the specified name, ornullif no element matches.Parameters
- name: string
Returns Element | null
The
HTMLCollection.lengthproperty returns the number of items in a HTMLCollection.MDN Reference