← 返回首页
HTMLTextAreaElement: cols プロパティ - Web API | MDN

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

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 2015年7月.

colsHTMLTextAreaElement インターフェイスのプロパティで、複数行テキストコントロールの見える幅を、平均的な文字幅における文字数で表す正の整数です。これは <textarea> 要素の cols 属性を反映します。

In this article

正の整数です。既定値は 20 です。

js
const textareaElement = document.getElementById("comment"); textArea.cols = 80;

仕様書

Specification
HTML
# dom-textarea-cols

ブラウザーの互換性

Enable JavaScript to view this browser compatibility table.

関連情報