Forms & Inputs
HTML <textarea> Tag
The <textarea> tag defines a multi-line text input control.
Definition and Usage
The <textarea> tag defines a multi-line text input control.
Standard Syntax:
<textarea>...</textarea>Interactive ExampleRunnable
HTML <textarea> Example
htmlLive code demonstration for the <textarea> tag. Click "Try it Yourself" to edit and experiment in real time.
<div style="font-family: system-ui, sans-serif; padding: 16px; background: #ffffff; border-radius: 8px; border: 1px solid #e2e8f0; color: #0f172a;">
<label for="w3review">Review of EA Academy:</label>
<textarea
id="w3review" name="w3review" rows="4" cols="50">
At EA Academy.com you will learn how to make a website. They offer free tutorials in all web development technologies.
</textarea>
</div>Attributes for <textarea>
12 Supported Attributes| Attribute | Values | Default | Description |
|---|---|---|---|
| autofocus | autofocus | none | Specifies that a text area should automatically get focus when the page loads |
| cols | number | none | Specifies the visible width of a text area |
| dirname | textareaname.dir | none | Specifies that the text direction of the textarea will be submitted |
| disabled | disabled | none | Specifies that a text area should be disabled |
| form | form_id | none | Specifies which form the text area belongs to |
| maxlength | number | none | Specifies the maximum number of characters allowed in the text area |
| name | text | none | Specifies a name for a text area |
| placeholder | text | none | Specifies a short hint that describes the expected value of a text area |
| readonly | readonly | none | Specifies that a text area should be read-only |
| required | required | none | Specifies that a text area is required/must be filled out |
| rows | number | none | Specifies the visible number of lines in a text area |
| wrap | hard soft | none | Specifies how the text in a text area is to be wrapped when submitted in a form |
Global Attributes
The <textarea> tag also supports the standard global attributes in HTML, including class, id, style, title, hidden, and data-*.
Event Attributes
The <textarea> tag supports event attributes in HTML, such as onclick, onmouseover, onfocus, and more.
Browser Compatibility
ChromeEdgeFirefoxSafariOpera
More Tags in Forms & Inputs
View All 123Tags →<button>The <button> tag defines a clickable button.<datalist>The <datalist> tag specifies a list of pre-defined options for an <input> element.<fieldset>The <fieldset> tag is used to group related elements in a form.<form>The <form> tag is used to create an HTML form for user input.<input>The <input> tag specifies an input field where the user can enter data.<label>The <label> tag defines a label for several elements: