Input Time min 属性
定义和用法
min
属性设置或返回时间字段的 min 属性的值。
HTML min 属性规定时间字段的最小值(时间)。
提示:如需设置或返回 max 属性的值,请使用 max 属性。
另请参阅:
HTML 参考手册:HTML <input> min attribute
实例
例子 1
获取时间字段允许的最短时间:
var x = document.getElementById("myTime").min;
例子 2
更改最小值:
document.getElementById("myTime").min = "08:00";
语法
返回 min 属性:
timeObject.min
设置 min 属性:
timeObject.min = hh:mm:ss.ms
属性值
值 | 描述 |
---|---|
hh:mm:ss.ms |
规定时间字段允许的最短时间。 组件说明:
例如:"08:39:21.33", "22:36:07" 或 "15:00"。 |
技术细节
返回值: | String value, indicating the minimum time allowed for the time field. |
---|
Browser support
The numbers in the table indicate the first browser version that fully supports this attribute.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 10.0 | Support | Support | Support |
Note:The <input type="time"> element does not display as any time field in Firefox.