How can I apply the selected class and remove any previously selected classes?
<html>
<select name="Button-Style" id="Button-Style" style="width:100%;">
<option value="Sun-Flower">Sun Flower</option>
<option value="orange-flat">Orange Flat</option>
</select>
<script>
$(document).ready(function(){
$('#Button-Style').change(function(){
if($(this).val() == 'Sun-Flower'){
$("#" + id).removeClass().addClass('sun-flower-button');
}
else if($(this).val() == 'orange-flat'){
$("#" + id).removeClass().addClass('orange-flat-button');
}
else{
}
});
});
</script>
</html>
I only want one class to be applied at a time.