how to show a jquery datepicker on button click

后端 未结 5 1279
清歌不尽
清歌不尽 2020-12-17 00:20

I want to show a datepicker only on button click


$(\"#day\").datepicker();

the above l

5条回答
  •  既然无缘
    2020-12-17 00:46

    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');
    });
    

提交回复
热议问题