demosthenes.info

A blog by Dudley Storey on , , , , , , and anything else that strikes his fancy.

featured articles

popular favourites

HTML Forms: The textarea tag

Text areas are for larger areas of text, such as a comments entry form for a blog. Oddly, textarea is not specified as the attribute of an <input> tag, but as its own tag.

As you will see, textarea is also an exception to most of the form-specific tags we have seen thus far in that it is a closed tag. If you ever see HTML spilling inside a textarea when you preview a web page, you know that you haven’t closed the <textarea> properly, since the textarea is filled with anything that comes immediately after the opening tag:

  1. <label for=“comment” accesskey=“m” >Your comments</label>
  2. <textarea name="comment" id=“comment” rows="5" cols="80">
  3. This is some default text
  4. </textarea>

The size of a <textarea>; is also defined inconsistently, through rows and cols attributes (the number of lines and characters per line that can be displayed in the textarea, respectively).

web developer guide

featured comment

by JoelB in Goodbye, JQuery Validation: HTML5 Form Errors With CSS3

what i'm reading

A Storm of Swords: A Song of Ice and Fire: Book Three
A Storm of Swords: A Song of Ice and Fire: Book Three

what i'm watching

Californication: The Third Season
Californication: The Third Season

what i'm playing

Mass Effect 3 Collector's Edition
Mass Effect 3 Collector's Edition

what i'm hearing

Dub FX
Dub FX

blogs

podcasts

no ads ever

This blog is free of advertising, and always will be.

creative commons licensed

The content of this blog is free to use in whatever way you wish under the Creative Commons license.