I want to show a datepicker only on button click
$(\"#day\").datepicker();
the above l
You need to initialize datepicker for your input field first
$('#input_filed').datepicker();
Then you need add trigger for button
$('#button').click(function() { $('#input_filed').datepicker('show'); });