Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need a input type for duration

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 Answers

<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='23'>
  <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>
like image 166
zer00ne Avatar answered Feb 03 '26 16:02

zer00ne



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!