JSFiddle - React, Tailwind, and code Playground
HTML
<select id="colorselector">
<option>Choose Color</option>
<option value="all">All</option>
<option value="red">Red</option>
<option value="green">Green</option>
</select>
<div class="red box">You have selected <strong>red option</strong> so i am here</div>
<div class="green box">You have selected <strong>green option</strong> so i am here</div>
CSS
.box{
color: #fff;
display: none;
margin-top: 20px;
}
.red{ background: #ff0000; }
.green{ background: #228B22; }
.blue{ background: blue; }
JavaScript
$(function() {
$('#colorselector').change(function(){
$('.box').hide();
if($(this).val() == 'all'){
$('.box').show()
} else {
$('.' + $(this).val()).show();
}
});
});