Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <textarea> wrap Attribute

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.

Example

#

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>

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.


Syntax

<textarea wrap="soft | hard">

Values

#

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:

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

You may also like

 Back to <textarea>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides