HTML DOM Textarea wrap Property

Textarea Object : Find out how the text in a text area should be wrapped when submitting a form

Definition and Usage

The wrap property sets or returns the value of the wrap attribute of a text area.

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

Browser Support

Property
wrap Yes Yes Yes Yes Yes

Syntax

Return the wrap property:

textareaObject.wrap

Set the wrap property:

textareaObject.wrap = soft|hard

Property Values

Value Description
soft The text in the text area is not wrapped when submitted in a form. This is default
hard The text in the text area is wrapped (contains newlines) when submitted in a form. When "hard" is used, the cols attribute must be specified

Technical Details

Return Value: A String, representing how the text area wraps text when submitted in a form

Related Pages

HTML reference: HTML <textarea> wrap attribute

❮ Textarea Object