HTMLCollection item()
HTMLCollection item() Method
The item() method is used to return elements at a specific index in HTMLCollection. Elements in it can be accessed by their index numbers that start at 0. Its length property will return the number of elements in HTMLCollection
Syntax:-
Its syntax is:- HTMLCollection[index] OR HTMLCollection.item(index)
Return:-
Its return is:- element at the specific index
Further Explanation:-
Parameter | Description |
index | Required. The index of the element to return. |