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