Form elements collection
Form Object
Example
Get the number of elements in the form:
var
x
=
document
.
getElementById
(
"
myForm
"
)
.
elements
.
length
;
Try it »
Definition and Usage
The elements collection returns all elements of the form as an array.
**Note:** The order of elements in the collection is arranged by their position in the source code.
**Note:** The elements collection returns all