HTMLTextAreaElement: wrap-Eigenschaft
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Die wrap
-Eigenschaft der HTMLTextAreaElement
-Schnittstelle gibt an, wie die Steuerung den Wert zur Formularübermittlung umbrechen soll. Sie spiegelt das wrap
-Attribut des <textarea>
-Elements wider. Beachten Sie, dass der Wert "hard"
nur dann Wirkung zeigt, wenn auch das cols
-Attribut gesetzt ist.
Wert
Siehe wrap
für die möglichen Werte. Standardwert ist "soft"
.
Beispiele
js
const textareaElement = document.getElementById("comment");
const oldWrap = textArea.wrap;
textArea.wrap = "hard"; // Add line breaks (CR+LF) during form submission
Spezifikationen
Specification |
---|
HTML # dom-textarea-wrap |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
wrap |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.