document.all provides a reference to an object that looks like an array containing all the elements of a document in Internet Explorer (IE). Document.forms[0] gives a pointer to the first form element in the document, in all browsers
At the same time 2. If your form had a name attribute, say "myform", then in IE this form can be specified using document.all.myform
document.all deprecated from IE version 5 and above. You can still use it, although it is still available in IE9. Often it is used to check if the IE browser is:
if (document.all) { //o no, it IE again! We have to do it another way! }
Linking to forms in the form Document.forms[0] is considered bad practice. Learn more about this here.
NOTE. Since this answer was first written, IE11 was introduced which refused to support document.all . See Compatibility Changes in IE11 for More Information.
source share