HTML <textarea> wrap attribute

Definition and usage

wrap The attribute specifies how the text in the text area is wrapped 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 include newline characters (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 wrapped. Default.
hard

When submitted in a form, the text in the text area will be wrapped (including newline characters).

Tip: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