Adding an Input Textbox

Input textboxes are used for a number of form needs, including any time you want someone to type out his name, address, and so forth. To create a textbox, you use the input element along with the type attribute and a value of text (see Example 5-2).

Example 5-2. Adding input textboxes

<form method="get" action="http://www.myserver.com/cgi-bin/mailscript/">First Name: <input type="text" /><br />Last Name: <input type="text" /><br />Phone: <input type="text" /></form>

As Figure 5-1 shows, using input with the type attribute for a text input generates a familiar-looking form.

Figure 5-1. Form inputs with text.

image

Of ...

Get Spring Into HTML and CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.