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

html
Try it Yourself
Live 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
AttributeValuesDefaultDescription
autofocusautofocusnoneSpecifies that a text area should automatically get focus when the page loads
colsnumbernoneSpecifies the visible width of a text area
dirnametextareaname.dirnoneSpecifies that the text direction of the textarea will be submitted
disableddisablednoneSpecifies that a text area should be disabled
formform_idnoneSpecifies which form the text area belongs to
maxlengthnumbernoneSpecifies the maximum number of characters allowed in the text area
nametextnoneSpecifies a name for a text area
placeholdertextnoneSpecifies a short hint that describes the expected value of a text area
readonlyreadonlynoneSpecifies that a text area should be read-only
requiredrequirednoneSpecifies that a text area is required/must be filled out
rowsnumbernoneSpecifies the visible number of lines in a text area
wraphard softnoneSpecifies 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-*.

HTML Global Attributes Reference →
Event Attributes

The <textarea> tag supports event attributes in HTML, such as onclick, onmouseover, onfocus, and more.

HTML Event Attributes Reference →

Browser Compatibility

ChromeEdgeFirefoxSafariOpera

More Tags in Forms & Inputs

View All 123Tags →