HTML <textarea> Tag.


An HTML text area :

 <textarea rows="4" cols="50">
At you will learn variety of free online courses. provides variety of free online courses and articles. Choose your own and Learn!.
Execute Code

Definition and Usage

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

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

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

Browser Support

The numbers in the table specify the first browser version that fully supports the element.

Element Chrome Internet Explorer Firefox Safari Opera
<textarea> Yes Yes Yes Yes Yes

Differences Between HTML 4.01 and HTML5

HTML5 has added several new attributes.


html5badge= New in HTML5.

Attribute Value Description
autofocus html5badgeautofocus Specifies that a text area should automatically get focus when the page loads
cols number Specifies the visible width of a text area
dirname html5badgetextareaname.dir Specifies that the text direction of the textarea will be submitted
disabled disabled Specifies that a text area should be disabled
form html5badgeform_id Specifies one or more forms the text area belongs to
maxlength html5badgenumber Specifies the maximum number of characters allowed in the text area
name text Specifies a name for a text area
placeholder html5badgetext Specifies a short hint that describes the expected value of a text area
readonly readonly Specifies that a text area should be read-only
required html5badgerequired Specifies that a text area is required/must be filled out
rows number Specifies the visible number of lines in a text area
wrap html5badgehard
Specifies how the text in a text area is to be wrapped when submitted in a form

Default CSS Settings