html - Is it possible to target a <select> with a specific option selected? -
say have following html:
<select> <option value="0">closed</option> <option value="1">open</option> </select>
i'd add border <select>
depends on selected value:
- red border when
closed
selected - green border when
open
selected
is there css selector target <select>
when value 0
or 1
?
this not possible purely in css, css not have understanding of selected dropdown option
s. (even if did, not possible match option
go parent select
).
as such, javascript option here. can provide example, didn't tag question javascript don't know if option you.
Comments
Post a Comment