The following code fails to properly clone the input element. Clicking/focusing on the cloned input opens the datepicker on the original input.
http://jsfiddle.net/musicisair/YUkZw/
<input>
<script>
var input = $("input").datepicker();
$("body").append("<br>Input 2: ").append(
input.clone(true);
);
</script>
Is there a correct way of cloning elements that have been bound with a jQuery UI widget? If so, what is is?
Source: http://api.jquery.com/clone/
I believe you are looking for the code above that actually copies the data associated with an element rather than sharing the data between elements.
Update
After messing around a few minutes with this here’s what I came up with:
And a demo: http://jsfiddle.net/YUkZw/5/