HTML and CSS Reference
Table 11.7 Properties of the elements Object
What It Describes
The name of the form object where the element was defined (read-
The name of the input device as specified in the HTML name attribute
The type of input device, such as radio, checkbox, password, and so
A Boolean value; if true the element is disabled so that it can't be
modified; even if it contains a value, data from a disabled form field is
not sent back to the server.
The text that is associated with the input device, such as the text
entered into the text area or textbox, the text that appears in a button,
and so on (read/write).
attribute that allows you to give your form a name. It is somewhat easier and more read-
able to reference a form by its name than by using the array syntax, such as forms and
forms . You will need the name attribute if you are submitting the form to a server-side
program as discussed in Section 11.4.1.
Any object, including the form, can also be referenced by using its unique ID and the
getElementById() method of the document, standardized by the W3C DOM.
In Example 11.6, two HTML forms are created: One contains a textbox, and the other
a button. Each of the forms is given a name with the name attribute and an id . In the
and its elements.
<head><title>Naming Forms object</title></head>
< form name="form1" id=”first_form” >
Enter your name:
value="Name: " />