HTML <textarea> tag

Usage

Defines a text area for the user to type in. Differs from a text input box in that textarea can have several rows rather than just one.

Example

Code:

<textarea rows="2" cols="30">
By including text in between
the textarea start and end tags
we can set the initial value
of the textarea
</textarea>

Output:

Required Attributes

  • rows - specifies the number of visible rows
  • cols - specifies the number of columns

Optional Attributes

  • disabled - the text area will be disabled when the page first loads
  • name - a unique name for the text area
  • readonly - the value of the text area cannot be modified

Core Attributes