HTML <textarea> wrap attribute

Definition and usage

wrap The attribute specifies how the text in the text area is line breaks when submitted in a form.

Example

When submitted in a form, the text in the text area that has been set to wrap="hard" will contain line breaks (if any):

<textarea rows="2" cols="20" wrap="hard">
At codew3c.com, you will learn how to develop websites. We provide free tutorials for all Web development technologies.
</textarea>

Try it yourself

Syntax

<textarea wrap="soft|hard">

Attribute value

Value Description
soft When submitted in a form, the text in the text area will not be line breaks. Default.
hard

When submitted in a form, the text in the text area will be line breaks (including line breaks).

Hint:When using "hard", the cols attribute must be specified.

Browser support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support