I want to show a datepicker using jQuery when user click on some text, and after the user select the date on datepicker, I can get the value from the date picker as javascript variable. My code is like this:
<div id="datepicker-container" style="display: none;">
<div id="select-delivery-date-input"> </div>
</div>
<a id="show-datepicker">Select Delivery Date</a>
<script>
$("#show-datepicker").click(function(){
$("#datepicker-container").show();
});
$('#select-delivery-date-input').datepicker({
dateFormat:'yy-m-d',
minDate: new Date(),
});
</script>
The problem is when the datepicker popup, when I tried to select the date on datepicker popup it won't close the datepicker popup.