HTML5“时间"输入间隔 [英] HTML5 "time" input interval
本文介绍了HTML5“时间"输入间隔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
也许我只是搜索不正确,但是没有人知道有一种方法可以使时间输入仅使用微调器基于预设的时间间隔递增.因此,如果是10分钟,请使向上箭头前进+10分钟,如果更改了小时,则它会自动+ 1小时
Maybe i am just not searching properly, but does anyone know of a way to have the time input only increment using the spinner based on a preset interval. So if it is 10 minutes, have the up arrow go +10 mins, if the hour changes it would automatically go + an hour
8:50-向上箭头的击球结束时间是9:00-或-8:50-向下箭头的击球结束时间是8:40
8:50 - Up arrow hit ends with 9:00 -OR- 8:50 - Down arrow hit ends with 8:40
推荐答案
当然,只需使用step属性,其中step指定要增加的秒数(60秒x 10分钟= 600秒):
Sure, just use the step attribute, where the step specifies the number of seconds to increment (60 sec x 10 mins = 600 seconds):
<input type="time" value="08:30:00" step="600">
jsFiddle example
这篇关于HTML5“时间"输入间隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文