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 HTMLAllCollection
interface HTMLAllCollection {
length: number;
"[iterator]"(): ArrayIterator<Element>;
item(nameOrIndex?: string): Element | HTMLCollection | null;
namedItem(name: string): Element | HTMLCollection | null;
[index: number]: Element;
}
length: number;
"[iterator]"(): ArrayIterator<Element>;
item(nameOrIndex?: string): Element | HTMLCollection | null;
namedItem(name: string): Element | HTMLCollection | null;
[index: number]: Element;
}
Indexable
Properties
Readonlylength
length: number
The HTMLAllCollection.length property returns the number of items in this HTMLAllCollection.
Methods
[iterator]
-
Returns ArrayIterator<Element>
item
-
The
item()method of the HTMLAllCollection interface returns the element located at the specified offset into the collection, or the element with the specified value for its id or name attribute.Parameters
OptionalnameOrIndex: string
Returns Element | HTMLCollection | null
namedItem
-
The
namedItem()method of the HTMLAllCollection interface returns the first Element in the collection whose id or name attribute matches the specified name, or null if no element matches.Parameters
- name: string
Returns Element | HTMLCollection | null
The
HTMLAllCollectioninterface represents a collection of all of the document's elements, accessible by index (like an array) and by the element's id. It is returned by the document.all property.MDN Reference