HTML:标记语言
CSS:样式语言
JavaScript:脚本语言
Web API:编程接口
所有 Web 技术
学习 Web 开发
发现我们的工具
更好地了解 MDN
此特性已相当成熟,可在许多设备和浏览器版本上使用。自 2015 年 7 月以来,各浏览器均已提供此特性。
HTMLTextAreaElement 接口的 value 属性表示 <textarea> 元素的取值,该取值是一个字符串。如果控件不包含任何内容,则返回空字符串。它会获取或设置控件中包含的原始值。
HTMLTextAreaElement
value
<textarea>
一个包含 <textarea> 元素内容的字符串。
const textareaElement = document.getElementById("comment"); const oldText = textArea.value; textArea.value = oldText.toUpperCase();
加载中…
HTMLTextAreaElement.textLength
HTMLTextAreaElement.labels
HTMLTextAreaElement.selectionStart
HTMLTextAreaElement.selectionEnd