Easy Tutorial
❮ Att Track Src Att Command Disabled ❯

HTML <textarea> Tag

Example

A HTML text area:


Browser Support

All major browsers support the <textarea> tag.


Tag Definition and Usage

The <textarea> tag defines a multi-line text input control.

The text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually Courier).

The size of the text area can be specified by the cols and rows attributes, or even better, through CSS's height and width properties.


Differences Between HTML 4.01 and HTML5

HTML5 added several new attributes.


Attributes

Attribute Value Description
autofocus New autofocus Specifies that the text area should automatically get focus when the page loads.
cols number Specifies the visible width of a text area.
disabled disabled Specifies that the text area should be disabled.
form New form_id Defines one or more forms the text area belongs to.
maxlength New number Specifies the maximum number of characters allowed in the text area.
name text Specifies a name for the text area.
placeholder New text Specifies a short hint that describes the expected value of the text area.
readonly readonly Specifies that the text area is read-only.
required New required Specifies that the text area is required/must be filled out.
rows number Specifies the visible number of lines in a text area.
wrap New hard <br>soft Specifies how the text in a text area is to be wrapped when submitted in a form.

Global Attributes

The <textarea> tag supports HTML's global attributes.


Event Attributes

The <textarea> tag supports HTML's event attributes.


Related Articles

HTML DOM Reference: Textarea Object

❮ Att Track Src Att Command Disabled ❯