I have a requirement of changing the color of a html select. I have search a lot but was not find a sample that works in IE. So, can I change the color of Disabled HTML Select Element in IE? I need a sample, in css or javascript or in jquery. Here is what I have tried.
<select disabled="disabled">
<option value="a">option A</option>
<option value="b">option B</option>
<option value="c">option C</option>
</select>
[disabled] {
color: #933;
background-color: #ffc;
}
select:disabled
{
border: solid 1px silver;
background-color: #F9F9F9;
color:blue;
}
[disabled] option {
background-color: #ffc; color: #933;
}
The solution is to use the ::-ms-value
selector:
select[disabled]::-ms-value {
color: red;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With