The wrap attribute on a textarea tag specifies how the submitted value should be wrapped.
Wrapping adds a newline character to the end of each line.
A wrap attribute on a textarea element.
A newline character is added at the end of each line.
<form action="/tutorial/action.html">
<textarea wrap="hard" name="text"
rows="5" cols="60">
Unlike most Dutch masters of the 17th century,
Rembrandt's works depict a wide range of style
and subject matter, from portraits and self-portraits
to landscapes, genre scenes, allegorical and
historical scenes, and biblical and mythological
themes as well as animal studies.
</textarea> <br /><br />
<input type="submit">
</form>
The wrap attribute specifies how the text should be wrapped during form submission.
If set to hard, all newlines in the value will be submitted in the form data.
For hard text wrapping to work properly, the textarea cols attribute should be set.
<textarea wrap="soft | hard">
| Value | Description |
|---|---|
| soft | This is default. No newline characters are appended to the lines. |
| hard | Appends a newline character to each line. |
Here is when wrap support started for each browser:
![]() Chrome
|
1.0 | Sep 2008 |
![]() Firefox
|
1.0 | Sep 2002 |
![]() IE/Edge
|
1.0 | Aug 1995 |
![]() Opera
|
1.0 | Jan 2006 |
![]() Safari
|
1.0 | Jan 2003 |
Back to <textarea>