I am attempting to add a border to an image when a radio button is checked.
Here is the HTML code I am working with:
<div class="frm_radio">
<label for="field_n9r1a2-0">
<input type="radio" name="x" id="t" value="Betreuung">
Betreuung
<img src="/wp-content/uploads/2016/03/unterichten_betreuen.jpg">
</label>
</div>
I have tried using the CSS selector :checked
but it does not seem to be working as expected.
input[type=radio]:checked img {
border: 2px solid red;
}
Could someone provide guidance on how to properly solve this issue?