HTML and CSS Reference
In-Depth Information
text and autofocus, before taking a look at the current state of browser
support and learning how you can take advantage of these new fea-
tures without leaving older browsers behind.
The limitations of HTML4 forms
HTML4 has a paltry selection of input types: three ways of entering
text and three ways of selecting from a predefined list of options. Let's
review what's available in HTML4 before you learn about the new fea-
tures available in HTML5 :
The text input is the workhorse of
HTML4 forms:
<input type="text" value="abc">
Usually, when you can't predict what
the user will want to enter but know it
will be fairly short, you have to use an
input of type text . This includes user-
names, dates and times, search terms,
email addresses, URL s, telephone num-
bers, currency, credit card numbers, and
any simple numeric values.
If the user needs to choose from a lim-
ited number of possible values, you can
use a <select> element. A <textarea> ele-
ment is for larger amounts of free text,
when you expect paragraphs rather than
a few words:
<option selected>Option 1
<option>Option 2</option>
<option>Option 3</option>
Search WWH ::

Custom Search