问题
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