Form.elements

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

							form.elements

Description

The elements property of the Form object represents the elements array, which is used to access each element within a form. The order of the form elements in the elements array is the order in which they appear in the HTML source.

Example

Listing 7.256 shows how to access form elements using the elements array. Because it is accessing the first element in the form, the index 0 is used. The second element in the form can be accessed with elements[1].

Listing 7.256 Accessing Form Elements
 <html> <head> <title> Using the form elements property</title> </head> <body> <script language="JavaScript"> <!-- Hide function getName(){ var textName ...

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.