Getting value from JQUERY datepicker

前端 未结 10 1907
故里飘歌
故里飘歌 2020-11-29 07:56

If I want to display the JQUERY UI datepicker inline by attaching it to a DIV like $(\"div#someID\").datepicker() - how do I access the chosen date? I assume if

10条回答
  •  伪装坚强ぢ
    2020-11-29 08:41

    You could do it as follows - with validation just to ensure that the datepicker is bound to the element.

    var dt;
    
    if ($("div#someID").is('.hasDatepicker')) {
        dt = $("div#someID").datepicker('getDate');
    }
    

提交回复
热议问题