The HTML wrap attribute
Quick answer
The HTML wrap attribute controls how line breaks are handled in the submitted value. It is used on the <textarea> element.
Overview
The wrap attribute controls how line breaks are handled in the submitted value. It applies to the <textarea> element.
With hard you must also set cols; the browser then inserts real line breaks at wrap points in the submitted text.
Syntax
<textarea wrap="hard" cols="20"></textarea>
Values
| Value |
|---|
| soft (default) | hard |
Best practices
Frequently asked questions
What does the wrap attribute do?
Controls textarea line wrapping on submit.
How do I set the size of a textarea?
Which elements use the wrap attribute?
It is an element-specific attribute, used on the <textarea> element.