持续时间需要输入类型 [英] Need a input type for duration

查看:114
本文介绍了持续时间需要输入类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在html输入中询问用户持续时间.

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

f.e. 03h 12m 12s

f.e. 03h 12m 12s

有什么办法可以给他一个选择,例如输入日期类型?

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

我使用Bootstrap 4.

I use Bootstrap 4.

谢谢

推荐答案

<input type='number'>设置minmax

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>

这篇关于持续时间需要输入类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆