Form.elements.length

JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax

							form.elements.length

Description

The elements.length property of the Form object specifies the number of items in the elements array. Each item in the array refers to an object in the HTML form.

Example

Listing 7.257 shows how to use the elements.length property. When the user clicks the Get Elements button, an alert box is displayed indicating the number of elements in the form.

Listing 7.257 Using the elements.length Property
 <html> <head> <title> Using the elements.length property of the Form object</title> </head> <body> <script language="JavaScript"> <!-- Hide // function uses the elements.length property to get the number of elements in the form. ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.