[jQuery] select value lost after clone in IE

[jQuery] select value lost after clone in IE


It seems that after a jQuery clone(), the value of select boxes are lost
in IE (but not Firefox). Try this out:
<div>
    <select>
        <option value="0">one</option>
        <option value="1" selected='selected'>two</option>
    </select>
</div>
$(function(){
$('div').clone(true).appendTo('body');
});
The first option will be selected in the cloned select.
Doing something like this fixes the problem (as long as there is only
one select box), though I suspect there needs to be a better fix in
jQuery explicitly:
$(function(){
var old = $('div');
var clone = old.clone(true);
var select_val = $('select', old).val();
$('select', clone).val(select_val);
clone.appendTo('body');
});
Cheers,
Jesse
www.thefutureoftheweb.com