How do I *completely* remove a jQuery UI datepicker?

后端 未结 4 873
北恋
北恋 2020-12-28 11:29

I\'ve got a date text field I wish to only sometimes attach a DatePicker to, because I have some of my own text-handling scripts which handle partial date strings.

4条回答
  •  一整个雨季
    2020-12-28 12:08

    This removes .datepicker COMPLETELY:

    $( selector ).datepicker( "destroy" );
    $( selector ).removeClass("hasDatepicker").removeAttr('id');
    

    Documentation:
    http://docs.jquery.com/UI/Datepicker#method-destroy
    also read the comments below

提交回复
热议问题