Reputation: 93
How do I display the current time in an input
whose type
is time
and hide its picker icon?
Thank you all.
Upvotes: 1
Views: 757
Reputation: 31992
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">
Upvotes: 1