HTML <textarea> wrap Attribute

The wrap attribute on a textarea tag specifies how the submitted text 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">

Using wrap

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.

Browser support

Here is when wrap support started for each browser:

1.0 Sep 2008
1.0 Sep 2002
1.0 Aug 1995
1.0 Jan 2006
1.0 Jan 2003

You may also like

 Back to <textarea>