Possible Duplicate:
problem when cloning jQuery UI datepicker
I used the jQuery clone function to clone a table with a datepicker function, but each time I clone a new table and try to click on its datepicker input, it appears on the default table that was cloned:
$('.clone_table').on("click", function() {
var $fromTable = $(this).closest(".contain");
var $cloneTable = $fromTable.clone(true);
$(".contain:last").after($cloneTable);
var selects = $fromTable.find("select");
$(selects).each(function(i) {
var select = this;
$cloneTable.find("select").eq(i).val($(select).val());
});
});