I current have this code that shows/hides content based on a select option.
How can i work into add and remove a class based on whatever the option is selected but without removing the .desarea?
<option value="country1">
<option valye="country2">
<div class="desarea country1">
//Create destination switch
$('#regionselect').change(function(){
var selected = $(this).find(':selected');
$('.regionDetail').fadeOut();
var count = $('.countrylist').length;
$('.countrylist').slideUp(function(){
if(!--count) {
$('.'+selected.val()).slideDown();
}
});
});
Is this what you want ?
EDIT
So is this better ? http://jsfiddle.net/pmEVU/2/