HTML DOM
The cols property of the HTMLTextAreaElement interface is a positive integer representing the visible width of the multi-line text control, in average character widths. It reflects the <textarea> element's cols attribute.
Value
A positive integer. Defaults to 20.
Examples
const textareaElement = document.getElementById("comment");
textArea.cols = 80;
Specifications
Browser compatibility
See also
- textarea
- HTMLTextAreaElement.rows
- HTMLTextAreaElement.wrap
- CSS resize property
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
