splitforms.com
guide · html elements

HTML Textarea — Multi-Line Text Input Reference

An HTML textarea is `<textarea>` — a multi-line text input. Unlike `<input>`, it has no `type` attribute (it's its own element). Configurable rows, max length, wrap behavior, and CSS-controlled resize.

html
<form action="https://splitforms.com/api/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY" />

  <label>Email<input name="email" type="email" required /></label>

  <!-- Basic textarea -->
  <label>
    Message
    <textarea name="message" rows="5" required></textarea>
  </label>

  <!-- Textarea with max length and char counter -->
  <label>
    Bio (max 500 chars)
    <textarea name="bio" rows="4" maxlength="500"
              placeholder="Tell us about yourself…"></textarea>
  </label>

  <!-- Locked resize, fixed size -->
  <label>
    Notes
    <textarea name="notes" rows="3"
              style="resize: vertical; min-height: 80px; max-height: 200px;"></textarea>
  </label>

  <button type="submit">Submit</button>
</form>

The HTML `<textarea>` element is a multi-line text input. Unlike `<input>`, it doesn't take a `type` attribute — `<textarea>` is its own element. The visible size is controlled by the `rows` and `cols` attributes (or by CSS height/width). The text content is the textarea's value — there's no `value` attribute; the value goes between the opening and closing tags.

Common attributes: `rows` (visible row count), `cols` (visible columns — usually ignored in favor of CSS width), `maxlength` (max character count, enforced natively), `required` (mandatory field), `placeholder` (hint text). The `wrap` attribute controls how line breaks are handled on submission — `soft` (default, no line breaks added) or `hard` (line breaks inserted at visible wrap points).

CSS `resize` controls whether the user can drag-resize the textarea. `resize: none` locks the size; `resize: vertical` allows vertical resizing only (recommended — horizontal resizing breaks page layout); `resize: both` is the default but rarely desirable.

Native textareas are accessible by default when paired with a `<label>`. Add a character counter for `maxlength`-restricted textareas — about 8 lines of JS that listens for `input` events and updates a `<span>` with `textarea.value.length / maxlength`. Don't write a custom textarea component; native is fine.

How to set this up

Step 01

Use <textarea>, not <input type="textarea">

There's no input type=textarea — it's its own element. <textarea name="x" rows="5"></textarea>.

Step 02

Set rows for visible size

rows="4" is a comfortable default. Use CSS height for finer control.

Step 03

Lock horizontal resize

resize: vertical (or resize: none). Horizontal resize breaks page layout.

Step 04

Add maxlength for char limits

maxlength="500" enforces the cap natively. Add a counter via 8 lines of JS for UX feedback.

<textarea>, not <input type=textarea>. Lock horizontal resize. Maxlength for caps.

Frequently asked questions

What is the correct HTML for making a text area?

<textarea name="x" rows="5"></textarea>. The textarea element is multi-line text input. It's NOT <input type="textarea"> — that doesn't exist.

How do I set the size of a textarea?

Use the `rows` attribute (number of visible rows) and CSS `height` / `width` for fine control. Avoid `cols` — use CSS width instead since it's more predictable across font sizes.

How do I disable resizing on a textarea?

CSS: `resize: none`. Or restrict to vertical-only with `resize: vertical`. The default `resize: both` is rarely desirable — horizontal resize breaks page layout.

How do I limit textarea length in HTML?

Add the `maxlength` attribute. The browser enforces the limit natively — users can't type beyond it. Add a character counter via JS for UX feedback: `textarea.value.length / maxlength`.

How do I add a placeholder to a textarea?

Use the `placeholder` attribute, same as on <input>: `<textarea placeholder="Your message…"></textarea>`. The placeholder disappears when the user starts typing. Don't use placeholder as a label — visible <label> elements are accessible; placeholders alone are not.

Related guides

HTML forms

HTML Form — How to Build and Submit Forms in HTML

HTML elements

HTML Button — Types, Attributes, and Common Patterns

HTML elements

HTML Input Types — Complete Reference (2026)

Ship the form, not the backend.

Free for 1,000 submissions/month. Email delivery, AI spam filtering, signed webhooks, real dashboard — all on the free plan. No credit card.

Get a free access key →