How do I display the current time in an input whose type is time and hide its picker icon?
Thank you all.
CodePudding user response:
You can set the input's valueAsDate property to the current date.
You can use the ::-webkit-calendar-picker-indicator pseudo-class to select the picker icon.
input.valueAsDate = new Date()
input[type="time"]::-webkit-calendar-picker-indicator {
background: none;
}
<input type="time" id="input">
