I have HTML like this one:
<select onclick="colorchanger()">
<option name="white" value="0">--Select--</option>
<option name="red" value="1">Work</option>
<option name="green" value="2">Doesn't Work</option>
</select>
I need to change select box color, when option is selected. I understand how to change color by using value, but i need to use name. Can anyone help? How to write javascript for this function?