Attributes · <textarea>
Which HTML Textarea attributes matter?
These attributes decide how the <textarea> behaves and what actually gets emailed to your inbox when someone submits.
| Attribute | What it does |
|---|---|
rows | The visible height in text lines. Sets the default size; CSS height overrides it. |
cols | The visible width in average characters. Prefer CSS width for real layouts. |
maxlength | Maximum number of characters the user can type. Enforce length limits server-side too. |
placeholder | A hint shown when the textarea is empty. Not a replacement for a <label>. |
required | Boolean. Blocks submit if the textarea is empty. |
wrap | soft (default) wraps visually but submits as one line; hard wraps and inserts line breaks. |
resize | CSS property — none, vertical, horizontal, or both. Default lets the user drag the corner. |




