HTMLTextAreaElement: wrap プロパティ

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.

wrapHTMLTextAreaElement インターフェイスのプロパティで、コントロールがフォーム送信用の値をどのように折り返し表示するかを示します。これは <textarea> 要素の wrap 属性を反映しています。 "hard" 値は、 cols 属性も設定されている場合にのみ効果があることに注意してください。

利用可能な値は wrap を参照してください。既定値は "soft" です。

js
const textareaElement = document.getElementById("comment");
const oldWrap = textArea.wrap;
textArea.wrap = "hard"; // フォーム送信で (CR+LF) を追加

仕様書

Specification
HTML
# dom-textarea-wrap

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
wrap

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報