JSFiddle - React, Tailwind, and code Playground
by Al. Karpuk
HTML
<select id="obj_select" onchange="changeColor()" style="background-color:red">
<option style="background-color:white">WHITE</option>
<option style="background-color:red" selected>RED</option>
<option style="background-color:green">GREEN</option>
<option style="background-color:blue">BLUE</option>
</select>
JavaScript
function changeColor() {
var obj = document.getElementById("obj_select")
obj.style.backgroundColor = obj.options[obj.selectedIndex].style.backgroundColor
}