HTML DOM Document all collection
- previous page all[]
- next page activeElement
- Go Up One Level HTML DOM Documents
Definition and Usage
all
The collection returns references to all HTML elements in the document.
Syntax
document.all[i] document.all[name] document.all.tags[tagname]
Description
all[]
It is a multi-functional array-like object that provides access to all HTML elements in the document.all[]
This array originated from IE 4 and has been adopted by many other browsers.
all[]
have been replaced by the standard arrays of the Document interface. getElementById() method and getElementsByTagName() method as well as the Document object's getElementsByName() method to replace it. Nevertheless, this all[]
arrays that are still in use in existing code.
all[]
The elements contained maintain the original order, and if you know their exact numeric position in the array, you can directly extract them from the array. However, it is more common to use all[]
An array that allows access to elements based on their HTML attributes name or id. If multiple elements have the specified name, an array of elements with the same name will be obtained.
- previous page all[]
- next page activeElement
- Go Up One Level HTML DOM Documents