Javascript Reference
Categories: Element

javascript Element all[ ]

@March 15, 2008, 1:22 a.m.
all[ ] NN n/a IE 4 DOM n/a  


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.

var inpVal = document.all.first_name.value;

Array (collection) of element object references in HTML source code order.


Current document's model.

Powered by Linode.