HTML and CSS Reference
In-Depth Information
EXAMPLE
11.5 (
CONTINUED
)
(Object Hierarchy using the array notations and the “name” attribute)
window
document
forms[0]
forms[1]
"form1"
"form2"
elements[0]
"yourname" "button1"
elements[1]
elements[0] elements[1]
"veggie"
"veggie"
value
value
"carrot"
"bean"
The
form
object is a property and child of the
document
object. Each form is an ele-
ment of the
forms[]
array and each form has properties that correspond to the HTML
attributes of the form as well as properties that describe the form. As discussed previ-
ously, these properties might be objects in their own right; for example, the
button
prop-
erty of the form is also an object with its own properties. Some of the properties of the
form
object are listed in Table 11.5 and methods are listed in Table 11.6. Properties of
the
elements
object are listed in Table 11.7.