Need a input type for duration

巧了我就是萌 提交于 2020-04-17 22:52:59

问题


I need to ask the user for a duration in a html input.

f.e. 03h 12m 12s

Is there any way to give him a selection, like input type date?

I use Bootstrap 4.

Thank you


回答1:


<input type='number'> set min and max

Demo

input,
label {
  font: inherit;
  width: 4ch;
}
<form id='duration'>
  <input id='h' name='h' type='number' min='0' max='24'>
  <label for='h'>h</label>
  <input id='m' name='m' type='number' min='0' max='59'>
  <label for='m'>m</label>
  <input id='s' name='s' type='number' min='0' max='59'>
  <label for='s'>s</label>
</form>


来源:https://stackoverflow.com/questions/47506366/need-a-input-type-for-duration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!