Write your code to get datepicker
$(function() {
$( "#secondbox" ).datepicker();
});
jQuery UI DatePicker provides option "show" and "hide". 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.
$(document).ready(function() {
$('#secondbox').datepicker();
$('#secondbox').focus(function() {
$(this).datepicker("show");
setTimeout(function() {
$('#secondbox').datepicker("hide");
$('#secondbox').blur();
}, 2000)
})
});