I want to have a select in which every options are displayed with their style. I search on the web and I found this :
Change Text Color of Selected Option in a Select Box
I made a snippet with this :
.greenText{ background-color:green; }
.blueText{ background-color:blue; }
.redText{ background-color:red; }
<select
onchange="this.className=this.options[this.selectedIndex].className"
class="greenText">
<option class="greenText" value="apple" >Apple</option>
<option class="redText" value="banana" >Banana</option>
<option class="blueText" value="grape" >Grape</option>
</select>
What I have here is good, but I want to display the colors of the options in the selection menu too (when we click on the select button, I want to have all the options displayed with their own color)
I want too see the colors too here :
Is it possible to doing this in HTML/CSS ? And perhaps with use of javascript/jquery ?