all | NN n/a IE 4 DOM n/a | |||
A collection of elements nested within the current element. A reference to document.all, for example, returns a collection (array) of all element objects contained by the document, including elements that may be deeply nested inside the document's first level of elements. The collection is sorted in source code order of the element tags. You can retrieve a reference to an element with its ID by any of the following syntaxes: document.all.elementID document.all["elementID"] document.all("elementID"] document.all.item("elementID") document.all.namedItem("elementID") |
||||
The W3C DOM equivalent (the document.getElementById( ) method) operates only from the document object, providing global reach to elements throughout the entire document. |
||||
Object Model Reference | ||||
elementReference.all
|
||||
Object-Specific Properties | ||||
|
||||
Object-Specific Methods | ||||
|
||||
Object-Specific Event Handler Properties | ||||
None. |
all[ ] | NN n/a IE 4 DOM n/a |
Read-only | |
Returns an array of all HTML element objects contained by the current element. Items in this array are indexed (zero-based) in source code order. The collection transcends generations of nested elements such that document.all[ ] exposes every element in the entire document. See the all object for a list of this property value's own set of properties and methods. |
|
As with all collections in Internet Explorer, you may use the traditional JavaScript array syntax (with square brackets around the index value) or IE's JScript alternative (with parentheses around the index value). If you are aiming for cross-browser deployment for collections that are available on both platforms, use the square brackets. |
|
Unless you develop strictly for IE browsers, consider migrating to W3C DOM references via document.getElementById( ), implemented in IE 5 and later and Netscape 6. |
|
Example | |
var inpVal = document.all.first_name.value; |
|
Value | |
Array (collection) of element object references in HTML source code order. |
|
Default | |
Current document's model. |
length | NN n/a IE 4 DOM n/a |
Read-only | |
Returns the number of elements in the collection. |
|
Example | |
var howMany = document.all.length; |
|
Value | |
Integer. |
item( ) | NN n/a IE 4 DOM n/a |
item(index[, subindex]) | |
Returns a single object or collection of objects corresponding to the element matching the index value (or, optionally, the index and subindex values). |
|
Parameters | |
|
|
Returned Value | |
One object or collection (array) of objects. If there are no matches to the parameters, the returned value is null. |
namedItem( ) | NN n/a IE 6 DOM n/a |
namedItem(IDOrName) | |
Returns a single object or collection of objects corresponding to the element matching the parameter string value. |
|
Parameters | |
|
|
Returned Value | |
One object or collection (array) of objects. If there are no matches to the parameters, the returned value is null. |
urns( ) | NN n/a IE 5(Win) DOM n/a |
urns(URN) | |
Returns a collection of nested element objects that have behaviors attached to them and whose URNs match the URN parameter. |
|
Parameters | |
|
|
Returned Value | |
A collection (array) of objects. If there are no matches to the parameters, the returned value is an array of zero length. |