// remove "selected" from any options that might already be selected$('#target option[selected="selected"]').each( function() { $(this).removeAttr('selected'); });// mark the first option as selected$("#target option:first").attr('selected','selected');