How to add only selected class and remove other class which is selected before?
<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>input").addClass('sun-flower-button');
}
else if($(this).val() == 'orange-flat'){
$("#" + id).addClass('orange-flat-button');
}
else{
}
});
});
</script>
</html>
I want to add only one class at a time.