I want to show datepicker using jQuery when the user clicks on some text, and after the user selects a date on datepicker, I can get the value from the date selection as a javascript variable. My code is as follows:
<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 that the datepicker popup when I tried to select a date on the datepicker popup will not close the datepicker popup.
Script example
source share