JSFiddle - React, Tailwind, and code Playground
by afshinprofe
HTML
<select>
<option class="red"><div class="red"></div>Red</option>
<option class="blue">Blue</option>
</select>
CSS
select{
width:200px;
}
.red{
width:20px;
height:20px;
//background:red;
background-image:url('http://cdn2.iconfinder.com/data/icons/splashyIcons/arrow_large_up.png');
background-position: right top;
}
.blue{
width:20px;
height:20px;
background:blue;
}
JavaScript
$(this).html($(this).html() == '▼ SHOW ▼' ? '▲ HIDE ▲' : '▼ SHOW ▼');