Textarea wrap attribute
Definition and usage
wrap
Attribute sets or returns the value of the wrap attribute of the text area.
The HTML wrap attribute specifies how the text in the text area should wrap when submitted in a form.
See also:
HTML Reference Manual:HTML <textarea> wrap attribute
Example
Find out how the text in the text area should wrap when submitting the form:
var x = document.getElementById("myTextarea").wrap;
Syntax
Return the wrap attribute:
textareaObject.wrap
Set the wrap attribute:
textareaObject.wrap = soft|hard
Attribute value
Value | Description |
---|---|
soft | When submitted in a form, the text in the text area does not wrap. Default. |
hard |
When submitted in a form, the text in the text area will be wrapped (including newline characters). Tip:When using "hard", it must be specified Cols attribute. |
Technical details
Return value: | String value indicating how the text area is wrapped when submitted in a form. |
---|
Browser support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |