HTML:标记语言
CSS:样式语言
JavaScript:脚本语言
Web API:编程接口
所有 Web 技术
学习 Web 开发
发现我们的工具
更好地了解 MDN
此特性已相当成熟,可在许多设备和浏览器版本上使用。自 2015 年 7 月以来,各浏览器均已提供此特性。
HTMLTextAreaElement 接口的 rows 属性是一个正整数,表示文本控件可见的文本行数。它反映了 <textarea> 元素的 rows 属性。
HTMLTextAreaElement
rows
<textarea>
一个正整数。默认为 2。
2
const textareaElement = document.getElementById("comment"); const textLines = textArea.rows; textArea.rows = textLines + 2;
加载中…
HTMLTextAreaElement.cols
HTMLTextAreaElement.wrap
resize