December 2001
Intermediate to advanced
480 pages
9h 22m
English
When you create a form in HTML, you create a form array. The development of an HTML form has a parallel array in JavaScript. As each form is developed, a form element is added to the array. Likewise, as each element within the form is developed, another subelement is added to the array. All forms in a form array are properties of the document object and are referenced as forms[n]. Within each forms[] element, all of the elements added in the <form> container are elements of the form[] object. Table 11.1 shows the HTML and JavaScript parallels in developing an array.
| HTML | JavaScript |
|---|---|
| <form name="first"> | document.forms[0]; |
| <input type=text> | document.forms[0].elements[0]; ... |
Read now
Unlock full access