item

The item JS HTMLCollection returns the element with index index from the collection. The elements are sorted in tree order.

Syntax

element = collection.item(index)
element = collection[index]

Parameters

index

The number of preceding siblings, or 0 if it has none.

Examples

1 · item · single

2 · item · multiple

3 · [ ] · single

4 · [ ] · multiple

length

namedItem

Web Hypertext Application Technology Working Group (WHATWG)

Home Menu