Subj : Re: Looking for standards document To : netscape.public.mozilla.jseng,netscape.public.mozilla.dom From : Martin Honnen Date : Mon Mar 07 2005 03:51 pm Crosspost/followup-to netscape.public.mozilla.dom. sukhisoul@yahoo.com wrote: > We have noticed that most browsers allow an element of > a form to be accessed as follows: > > document.forms[0][0] > > Basically, double-indexing forms array gives corresponding > element of elements array of that form. > Can somebody refer me to the standards document that > mandates this? The W3C DOM Level 2 HTML module should cover this, document.forms is defined here as a HTMLCollection which is defined here as having two methods item and namedItem. For JavaScript the ECMAScript binding is relevant which says here "item(index) This function returns an object that implements the Node interface. The index parameter is a Number. Note: This object can also be dereferenced using square bracket notation (e.g. obj[1]). Dereferencing with an integer index is equivalent to invoking the item function with that index." Thus at least document.forms[0] is part of the W3C DOM standard. The shortcut document.forms[0][0] for document.forms[0].elements[0] is not formally specified I think but has traditionally been possible in the browser DOM ever since forms have been exposed to script. -- Martin Honnen http://JavaScript.FAQTs.com/ .