I have an HTML5 date picker.
It is opened when I click on the date picker text box.
Todo :
- I have to change the event to an icon, but I'm not sure how to achieve this.
I have to open the date picker when I click on the calendar icon.
Here is the HTML code for my datepicker:
<img src="date.png" alt="Date Picker" id="datepickericon" />
<input name="calendarselect{ContactID}" class="timeselect" type="date" id="calendar">
<script>
document.getElementById("datepickericon").onclick = function(e){
console.log('inside click');
document.getElementById("calendar").style.visibility="visible";
// document.getElementById("calendar").focus();
// You could write code to toggle this
}
By clicking on icon i have to get the open calendar view like following image