GO-V.ORG
As seen in

HTMLTextAreaElement: wrap property

HTML DOM

HTML DOM

The **`wrap`** property of the HTMLTextAreaElement interface indicates how the control should wrap the value for form submission. It reflects the `<textarea>` element's [`wrap`](/docs/Web/HTML/Reference/Elements/textarea#wrap) attribute. Note that the `"hard"` value only has an effect when the cols attribute is also set.

## Value

See [`wrap`](/docs/Web/HTML/Reference/Elements/textarea#wrap) for the possible values. Defaults to `"soft"`.

## Examples

```js
const textareaElement = document.getElementById("comment");
const oldWrap = textArea.wrap;
textArea.wrap = "hard"; // Add line breaks (CR+LF) during form submission
```

## Specifications

## Browser compatibility

## See also

- textarea
- HTMLTextAreaElement.cols

source: MDN Web Docs mirror · page

Cite this

"HTMLTextAreaElement: wrap property". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/wrap

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·