HTML:標記語言
CSS:樣式語言
JavaScript:指令碼語言
Web API:程式設計介面
所有 Web 技術
學習 Web 開發
發現我們的工具
更好地瞭解 MDN
此特性已相當成熟,可在許多裝置和瀏覽器版本上使用。自 2015 年 7 月以來,各瀏覽器均已提供此特性。
HTMLInputElement 介面的 max 屬性反映了 <input> 元素的 max 屬性,該屬性通常定義了數字或日期時間輸入的有效最大值。如果未顯式設定該屬性,則 max 屬性為空字串。
HTMLInputElement
max
<input>
一個表示元素 max 值的字串,如果未顯式設定 max,則為空字串。
const inputElement = document.querySelector("#time"); console.log(inputElement.max); // the current value of the max attribute inputElement.max = "18:00:00"; // sets the max value to 6pm
載入中…
HTMLInputElement.min
HTMLInputElement.value
HTMLInputElement.type