HTML input time, step attribute to set timestep by (say) x minutes?

后端 未结 4 1883
南笙
南笙 2021-01-17 22:26

I have a time input, basically just:

Time:  

http://jsfiddle.net/X8E9N/

According to

相关标签:
4条回答
  • 2021-01-17 22:46

    Yes. You can specify step attribute in seconds.

    However, Opera, iOS Safari, and Google Chrome don't reject non-aligned user input. A user can specify 11:59 to such time field. Then, Opera and Google Chrome show a validation error message when he tries to submit the form.

    0 讨论(0)
  • 2021-01-17 22:46

    Seems like Chrome 86 does not support this.

    0 讨论(0)
  • 2021-01-17 22:55

    As of iOS 9.1, iOS doesn't support max min or step.

    http://caniuse.com/#feat=input-datetime

    0 讨论(0)
  • 2021-01-17 22:56

    It's possible. You just need to put seconds in step parameter, ex.

    <input type="time" step="300"> <!-- 5 min step -->

    0 讨论(0)
提交回复
热议问题