allNN 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
 
length
 
Object-Specific Methods
 
item( )namedItem( )tags( )urns( )
 
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.

lengthNN 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
 
index

When the parameter is a zero-based integer, the returned value is a single element corresponding to the specified item in source code order (nested within the current element); when the parameter is a string, the returned value is a collection of elements whose id or name properties match that string.

subindex

If you specify a string value for the first parameter, you can use the second parameter to specify a zero-based index that retrieves the specified element from the collection whose id or name properties match the first parameter's string value.

 
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
 
IDOrName

The string that contains the same value and case as the desired element's id or name attribute.

 
Returned Value

One object or collection (array) of objects. If there are no matches to the parameters, the returned value is null.

tags( )NN n/a IE 4 DOM n/a  

tags(tagName)

  

Returns a collection of objects (among all objects nested within the current element) whose tags match the tagName parameter.

 
Parameters
 
tagName

A case-insensitive string that contains the element tag name only (no angle brackets), as in document.all.tags("p").

 
Returned Value

A collection (array) of objects. If there are no matches to the parameters, the returned value is an array of zero length.

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
 
URN

A string with a local or external behavior file URN.

 
Returned Value

A collection (array) of objects. If there are no matches to the parameters, the returned value is an array of zero length.