Firefox Tomorrow

web api instance property

HTMLTextAreaElement: wrap property

View on MDN ↗

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 attribute. Note that the "hard" value only has an effect when the cols attribute is also set.

Value

See wrap for the possible values. Defaults to "soft".

Examples

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

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also