jquery clone select doesnt keep value

The option element maintains its current selectedness with the selected javascript property (not to be confused with the selected attribute, which corresponds to default selectedness).

Since jQuery’s clone doesn’t clone the current selectedness (http://bugs.jquery.com/ticket/1294) , you’ll have to do it manually:

$('#form-to-submit').html($(fieldsetName).clone());
$('#form-to-submit select').val($('.fieldsetwrapper select').val());

Leave a Comment