Cloning datepicker objects [JQuery]

后端 未结 4 698
温柔的废话
温柔的废话 2021-01-02 12:25

I have an input field that I define as a datepicker through a css class. I now want to clone this input field and have it so the cloned inputs are also datepickers.

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-02 12:28

    Change it to this:

    $('.calendar:last').clone(false).removeClass('hasDatepicker').insertAfter('.calendar:last').datepicker();
    

提交回复
热议问题