I'm trying to use CSS, but it seems like this is not possible:
Since you are also targeting a tag select, not a tag option, this selector means that any element selectnested inside the element has.select class
select option[selected] {
color: red;
}
Demo
You use classso you can make a type selector
.select option[selected] {
color: red;
}
source
share