HTML <textarea> wrapProperty

HTML <textarea> Tag

Example

Text areas with wrap="hard" will include line breaks (if any) when the form is submitted.

<textarea rows="2" cols="20" wrap="hard">Example provides the most comprehensive web technology tutorials.</textarea>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the wrap attribute.


Definition and Usage

The wrap attribute specifies how the text in a text area is to be wrapped when the form is submitted.


Differences between HTML 4.01 and HTML5

The wrap attribute is a new attribute of the <textarea> tag in HTML5.


Syntax

<textarea wrap="soft|hard">

Property value

Value Description
soft By default, the text wraps when it reaches the element's maximum width, but no line breaks are automatically inserted—meaning no line breaks are included when the form is submitted.
hard When the text reaches the element's maximum width, the browser automatically inserts line breaks (CR+LF). That is, line breaks are also submitted with the form. When using "hard", the cols attribute must be specified.


HTML <textarea> Tag

other extensions