JSFiddle - React, Tailwind, and code Playground
HTML
<span>This is the span</span>
<div>This is the div</div>
<select>
<option>-</option>
<option>Hide the <span></option>
<option>Hide the <div></option>
</select>
JavaScript
$('select').change(function() {
switch (this.selectedIndex) {
case 0:
break;
case 1:
$('span').slideUp(500, function() {
$(this).show();
});
break;
case 2:
$('div').slideUp(500, function() {
$(this).show();
});
break;
}
});