HTML and CSS Reference
In-Depth Information
<td>
<input type="text" id="firstNameText"/>
</td>
</tr>
<tr>
<td>
Last Name:
</td>
<td>
<input type="text" id="lastNameText"/>
</td>
</tr>
<tr>
<td>Other Comments:
</td>
<td>
<textarea id="otherCommentsText" rows="5" cols="20"></textarea>
</td>
</tr>
</table>
Figure 3-1 shows the output of this code.
FIGURE 3-1 HTML markup showing text box data-entry fields
This code adds text boxes to capture information such as first name, last name, and
additional comments. For the first and last names, the input is a standard text box as denoted
by type=”text” . This tells the renderer to display an input field into which users can enter free-
form text. However, this type of input field is limited to a single line. The Other Comments
text box provides a multiline text area for users to enter text into. The rows and cols attributes
define the viewable size of the text area. In this case, users can enter many lines of text into
the text area.
Other attributes that help with controlling how much information is entered into the text
fields is the maxlength attribute:
<input type="text" id="firstNameText" maxlength="50"/>
Search WWH ::




Custom Search