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