The <textarea> element is a multi-line plain-text control. Use it when users need more than one line — comments, messages, reviews, or notes. For a single line, prefer <input>.
Always pair it with a <label>. Set size with rows / cols (or CSS), and submit the field with name inside a <form>. Put the starting text between the tags — not in a value attribute.
Baseline · Widely available.
Not deprecated. Core textarea support has been stable across browsers since about July 2015 (and much earlier in practice).
Content vs JavaScript.
In HTML, initial text sits between <textarea>…</textarea>. In JavaScript, read/write the current text with the value property.
Syntax
HTML Syntax
syntax.html
<textarea name="field">text</textarea>
Both start and end tags are required. Content is plain text only (no nested HTML elements).
Reference
Attributes
The attributes you will use most often on <textarea>:
maxlength="120" stops typing past 120 characters in supporting UIs.
Optional minlength marks short text invalid, but empty can still pass without required.
Style validity with CSS :valid / :invalid if you want visual feedback.
Example 4 — readonly vs disabled
Both prevent edits; only readonly stays in the submit payload and remains focusable.
HTML
<label for="note-ro">Read-only note</label>
<textarea id="note-ro" name="note_ro" rows="3" cols="30" readonly>
Saved answer — you can select this text.
</textarea>
<label for="note-dis">Disabled note</label>
<textarea id="note-dis" name="note_dis" rows="3" cols="30" disabled>
This value is not submitted.
</textarea>
readonly: no edits, still focusable, value is submitted.
disabled: no edits, not focusable, value is skipped on submit.
Pick readonly when the user should see/copy a fixed answer that still posts.
Pick disabled when the control is inactive and should not send data.
Edge Cases & Pitfalls
Most textarea issues are missing labels, wrong defaults, or confusing readonly with disabled.
a11y
Placeholder is not a label
Always provide a visible <label>. Placeholder text vanishes while typing and is easy to miss.
content
No value attribute
Initial HTML text goes between the tags. Use the JS value property to read or change the current text.
resize
Users can resize by default
Browsers often show a drag handle. Limit or disable it with CSS resize when layout must stay fixed.
validation
minlength alone allows empty
An empty field can still be valid unless you also set required.
layout
Avoid vertical-align: baseline
Browsers disagree on the textarea baseline, so that alignment can look inconsistent.
Compatibility
Browser Support
The <textarea> element is core HTML form control markup in every browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<textarea>
Widely available since about July 2015 (and long before). rows, cols, name, placeholder, required, and maxlength work everywhere modern. Some extras like autocorrect vary by engine.
98%Global support (approx.)
Google ChromeAll
Full support
Mozilla FirefoxAll
Full support
Apple SafariAll
Full support
Microsoft EdgeAll
Full support
OperaAll
Full support
Samsung InternetAll
Full support
Internet ExplorerAll
Supported
<textarea>Widely supported
Bottom line: Safe to use for multi-line form text. Label every field, set rows/cols or CSS size, and choose readonly vs disabled carefully.
Remember
Key Takeaways
Role:<textarea> is for multi-line plain text in forms.
Label + name: accessible name in HTML; submitted name in the form data.
Size: set rows/cols or CSS; defaults differ by browser.
Content: initial text between tags; JS uses the value property.
One line: use a labeled <textarea name="…"> for multi-line text, with rows/cols (or CSS) for a predictable size.
UA style
Default CSS Settings
Typical user-agent styling for textarea (simplified; exact rules vary by browser):
default.css
textarea {
display: inline-block;
white-space: pre-wrap;
overflow-wrap: break-word;
font: inherit;
/* often resizable by default via the resize property */
}
Set width: 100% and a sensible max-width for mobile layouts, and use resize: vertical (or none) when you need predictable height.
Frequently Asked Questions
The textarea element is a multi-line plain-text field. Use it for comments, messages, reviews, or any longer free-form text in a form.
input is usually one line (text, email, password, and so on). textarea is multi-line. Put the starting text between the textarea tags, not in a value attribute.
No, but setting them is a good habit because browser defaults differ. You can also size the control with CSS width and height.
No. Always use a visible label associated with the textarea. Placeholder is only a short hint and disappears while typing.
Both prevent editing. readonly stays focusable and its value is submitted with the form. disabled is not focusable and is not submitted.
No. An empty textarea can still be valid with minlength unless you also set required.