**`<textarea>`** is for free-form, multi-line text — comments, messages, descriptions — where `<input type="text">` (a single line) wouldn't fit. Unlike `<input>`, its default content goes BETWEEN the opening and closing tags (not in a `value` attribute), and its `rows`/`cols` attributes suggest an initial visible size, though users can typically resize it further via the browser's built-in drag handle unless that's disabled with CSS `resize: none`.
1Understanding <textarea>
`<textarea>` is for free-form, multi-line text — comments, messages, descriptions — where <input type="text"> (a single line) wouldn't fit. Unlike <input>, its default content goes BETWEEN the opening and closing tags (not in a value attribute), and its rows/cols attributes suggest an initial visible size, though users can typically resize it further via the browser's built-in drag handle unless that's disabled with CSS resize: none.
Unlike most form controls, a <textarea>'s starting text goes between its tags, not in a value attribute — <textarea value="..."> silently does nothing.
<label for="comment">Comment</label>
<textarea id="comment" name="comment" rows="5" placeholder="Write your comment..."></textarea>2Practical Example
Here is a real-world application of <textarea> showing how it is used in production HTML.
<!-- Pre-filled multi-line default content -->
<textarea name="bio" rows="3">I'm a web developer who loves building accessible websites.</textarea>3Best Practices
Follow these guidelines when working with <textarea>:
1. Use <textarea> for genuinely multi-line content like comments or messages
2. Set rows/cols (or CSS) to a sensible initial size for the expected content length
3. Use maxlength to cap input length when there's a real constraint (e.g. a database column limit)
Tip: Unlike most form controls, a <textarea>'s starting text goes between its tags, not in a value attribute — <textarea value="..."> silently does nothing.
<label for="comment">Comment</label>
<textarea id="comment" name="comment" rows="5" placeholder="Write your comment..."></textarea>