Javascript Reference
Categories: FORM

javascript FORM elements[ ]

@March 15, 2008, 1:22 a.m.
elements[ ]Firefox/Netscape/NN 2 IE 3 Chrome/Safari/DOM 1  

Read-only  

Returns an array of all form control objects contained by the current form.

 
Example
 
for (var i = 0; i < document.entryForm.elements.length; i++) {
    if (document.entryForm.elements[i].type == "text") {
        document.entryForm.elements[i].value = "";
    }
}
 
Value

Array of element object references.

 
Default

Array of length zero.


Powered by Linode.