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 &lt;span&gt;</option>
    <option>Hide the &lt;div&gt;</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;
    }
});