Show Hide jQuery UI DatePicker Programmatically
jQuery UI DatePicker provides option "show" and "hide" to show/hide the DatePicker. So the idea was to show the DatePicker when textbox gets focus (using focus event) and call setTimeout to hide the datepicker after 2 seconds.
Read How to use jQuery setTimeout function
//Code Starts $(document).ready(function() { $('#txtDate').datepicker(); $('#txtDate').focus(function() { $(this).datepicker("show"); setTimeout(function() { $('#txtDate').datepicker("hide"); $('#txtDate').blur(); }, 2000) }) }); ??//Code Ends
See result below.
Feel free to contact me for any help related to jQuery, I will gladly help you.