A Custom Element for <input type="duration">
.
References:
- Browser support
- Web standards
<!-- Include `InputDurationElement` -->
<script src="https://unpkg.com/[email protected]" type="module"></script>
<!-- Render `<input-duration>` -->
<label for="duration">Duration</label>
<input-duration id="duration" name="duration"></input-duration>
max
(number
): Max value of duration in seconds.name
(string
): Input name.value
(number
): Default value of duration in seconds.
::part(divider)
: Divider (:
).
hour
: Default to:
.minute
: Default to:
.second
: Default to empty.
inputDuration.value = number
sets duration value to number in seconds.inputDuration.value
gets duration value to number in seconds.
change
fires when duration value changes.
- Support
min
- Validation
- Figure out
maxLength
,max
,size
.