HTML
Example
An HTML text area:
Try it »
Browser support





All major browsers support
Tag Definition and Usage
A text area can hold an unlimited amount of text, and the default font of the text in it is a monospace font (usually Courier).
you can specify the size of a textarea through the cols and rows attributes, but a better way is to use the CSS height and width properties.
Differences Between HTML 4.01 and HTML5
HTML5 adds some new attributes.
Attribute
New: New attribute in HTML5.
| Attribute | Value | Description |
|---|---|---|
| autofocusNew | autofocus Specifies that the text area should automatically get focus when the page loads. colsnumberSpecifies the visible width of a text area. disableddisabled Specifies that the text area should be disabled. formNewform_idDefines one or more forms the text area belongs to. maxlengthNewnumberSpecifies the maximum number of characters allowed in the text area. nametextSpecifies the name of the text area. placeholderNewtextSpecifies a short hint that describes the expected value of the text area. readonlyreadonly Specifies that the text area is read-only. requiredNew required Specifies that the text area is required/mandatory. rowsnumberSpecifies the visible number of lines in a text area. wrapNew hard soft Specifies how the text in a text area should be wrapped when the form is submitted.