HTML DOM forms collection
Document Object
Definition and Usage
The forms collection returns an array collection of all forms on the current page.
Syntax
document.forms[]
.property
Browser support





All major browsers support the forms collection
Example
Example 1
Returns the number of forms in the document:
Number of forms:
The example above produces the following output:
Number of forms: 3
Try it »
Example 2
Returns the name of the first form in the document:
Name of the first form:
The example above produces the following output:
Name of the first form: Form1
Try it »
Document Object