JSFiddle - React, Tailwind, and code Playground
HTML
<DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="box" style="width:100px; height:100px; background-color:brown;"></div>
<select id="selectedColor" onchange="changeColor()">
<option value="red">red</option>
<option value="bule">bule</option>
<option value="purple">purple</option>
</select>
</body>
</html>
JavaScript
function changeColor() {
var selectColor = document.getElementById("selectedColor").value;
var box = document.getElementById("box");
box.style.backgroundColor = selectedColor;
}