HTMLInputElement: min 属性

Baseline 已广泛支持

此特性已相当成熟,可在许多设备和浏览器版本上使用。自 ⁨2015 年 7 月⁩以来,各浏览器均已提供此特性。

HTMLInputElement 接口的 min 属性反映了 <input> 元素的 min 属性,该属性通常定义了数字或日期时间输入的最小值。如果未显式设置该属性,则 min 属性为空字符串。

一个字符串,表示元素的 min 值,如果未显式设置 min,则为空字符串。

示例

js
const inputElement = document.querySelector("#range");
console.log(inputElement.min); // the current value of the min attribute
inputElement.min = 0; // sets the min value to "0"

规范

规范
HTML
# dom-input-min

浏览器兼容性

另见