Is there any way to set the text colour of a selected option in mozilla?
https://jsfiddle.net/36sk6wd0/9/
<option selected>blue?</option>
You can change the background using a linear gradient, but is there some hack to change the colour as well?
Is there any way to set the text colour of a selected option in mozilla?
https://jsfiddle.net/36sk6wd0/9/
<option selected>blue?</option>
You can change the background using a linear gradient, but is there some hack to change the colour as well?
use this link. i hope it's very helpful to you
$(document).ready(function() {
$(document).on("click", "#changeColor", function() {
$("option").removeClass("change_color");
$("#changeColor :selected").addClass("change_color")
})
})
.change_color{
color:green;
background-color:yellow;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<select id="changeColor">
<option>red</option>
<option>red</option>
<option>red</option>
</select>