problem when cloning jQuery UI datepicker

后端 未结 12 1609
谎友^
谎友^ 2020-11-29 05:36

I have a div in which there is a datepicker. I use something like this to clone it:

mydiv = $(\'#someDiv\');

// works fine so far
mydiv.find(\'input.datefie         


        
12条回答
  •  情深已故
    2020-11-29 06:06

    Datepicker doesn't if the ID of an element is changed. So, it is better not to change the id of a element if it is must required. But if you really needs to change the ID and that changed id needs to work with datepicker then follow it:

    $(selector).removeClass('hasDatepicker');
    $(selector).datepicker({
      changeMonth: true,
      changeYear: true
    });

提交回复
热议问题