HTMLTextAreaElement: wrap property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{ APIRef("HTML DOM") }}
The **wrap** property of the {{DOMxRef("HTMLTextAreaElement")}} interface indicates how the control should wrap the value for form submission. It reflects the <textarea> element's [wrap](/en-US/docs/Web/HTML/Reference/Elements/textarea#wrap) attribute. Note that the "hard" value only has an effect when the {{domxref("HTMLTextAreaElement.cols", "cols")}} attribute is also set.
Value
See [wrap](/en-US/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 submissionSpecifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- {{HTMLElement("textarea")}}
- {{DOMXref("HTMLTextAreaElement.cols")}}