I'm looking for a way to show the calendar with a button just as if you clicked the drop-down arrow in the input box. Target = Chrome(65+)
There are a few questions that have addressed this but I cant get it working for the browser. Like this one: Is there a JavaScript method to make a html date input display the datepicker?
Ideally, Id like the date input itself to not be visible, and the calendar widget show when the button is pressed(space is important).
<button type="button" onclick="openCalendar()">
<img src="...Images/calendar.png" height="25"/></button>
<input id="datePick" type="date" style="visibility:hidden;width:0px">
in script:
function openCalendar() {
document.getElementById('datePick').style.visibility = "visible"
document.getElementById('datePick').focus().click() // this is the line!!
}
In other words, the entire input element would be replaced by a button, the value would not be shown. I would think bootstrap/jQuery unnecessary for this in chrome, anybody know? Thanks