HTML
Example
A text area with wrap="hard" will include line breaks (if any) when the form is submitted:
<
textarea
rows
=
"
2
"
cols
=
"
20
"
wrap
=
"
hard
"Runoob Tutorial provides the most comprehensive web technology tutorials.
textarea
Try it »
Browser support





All major browsers support the wrap attribute.
Definition and Usage
The wrap attribute specifies how the text in the text area is wrapped when the form is submitted.
Differences between HTML 4.01 and HTML5
The wrap attribute is new in HTML5
Syntax
Attribute values
| Value | Description |
|---|---|
| soft | By default, when the maximum width of the element is reached, the text wraps, but no line break is inserted automatically, meaning there is no line break when the form is submitted. |
| hard | when the text reaches the maximum width of the element, the browser automatically inserts a line break (CR+LF). That is, line breaks are also submitted when the form is submitted. When using "hard", the cols attribute must be specified. |
HTML