HTMLTextAreaElement: cols プロパティ
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.
cols
は HTMLTextAreaElement
インターフェイスのプロパティで、複数行テキストコントロールの見える幅を、平均的な文字幅における文字数で表す正の整数です。これは <textarea>
要素の cols
属性を反映します。
値
正の整数です。既定値は 20
です。
例
js
const textareaElement = document.getElementById("comment");
textArea.cols = 80;
仕様書
Specification |
---|
HTML # dom-textarea-cols |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
cols |
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.
関連情報
<textarea>
HTMLTextAreaElement.rows
HTMLTextAreaElement.wrap
- CSS
resize
property