Section 25.133. Form.elements: the input elements of a form


25.133. Form.elements[]: the input elements of a form

DOM Level 2 HTML

25.133.1. Synopsis

 readonly HTMLCollection elements 

25.133.2. Description

elements[] is an array-like HTMLCollection of the form elements (such as Input, Select, and Textarea objects) that appear in an HTML form. The elements of the array are in the same order they appear in the HTML source code for the form. Each element has a type property whose string value identifies its type.

25.133.3. Usage

If an item in the elements[] array has been given a name with the name="name" attribute of its HTML <input> tag, that item's name becomes a property of form, and this property refers to the item. Thus, it is possible to refer to input elements by name instead of by number:

 form.name 

25.133.4. See Also

Input, HTMLCollection, Select, Textarea




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net