Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Form length property

Form length property

Form Object Reference Form Object


Definition and Usage

The length property can return the number of elements in the form.

Syntax

formObject.length


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the length property.


Example

Example

The following example returns the number of elements in the form:

First name:

Last name:

The example above produces the following output:

3

Try it »


More examples

Get the value of each element in the form


Form Object Reference Form Object