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