Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Text Areas

The <input type="text"> attribute mentioned earlier only allows the user to enter a single line of text. When you want to allow multiple lines of text in a single input item, use the <textarea> and </textarea> tags instead. Any text you include between these two tags is displayed as the default entry. Here's an example:

<textarea name="comments" rows="4" cols="20">
Please send more information.
</textarea>

As you probably guessed, the rows and cols attributes control the number of rows and columns of text that fit in the input box. Text area boxes do have a scrollbar, however, so the user can enter more text than fits in the display area.

Share ThisShare This

Informit Network