I have the following HTML and for the life of me cannot figure out how to get the style to behave how I'd like.
<span>
<span>
<input id="myRadio" name="tab" role="radio" aria-checked="false" type="radio">
</span>
<label for="myRadio">Label</label>
<span>
I would like to be able to change the background color of the label or the outer span whenever the Radio Button is selected. I am not able to change the HTML since it is generated server side, otherwise I'd remove the span
that surrounds the input
and then use a sibling selector.
Is there any way to accomplish this without the use of javascript? I've got a feeling I won't be able to since there's no parent selector but I wanted to ask before giving up on the idea.