I have a label I need styled depending on the state of the checkbox inside. Unfortunately I am constrained about changing the html structure! (Last resort is a javascriptsolution).
Is it even possible with a html structure as below
.like-this {
border: 1px solid black;
background: white;
color: black;
padding: 2px 4px;
}
.selected {
background: red;
color: white;
}
<label>
<input type="radio" name="field_123" value="Yes" class="Radio-Button">
I need same border
</label>
<label>
<input type="radio" name="field_123" value="No" class="Radio-Button"">
I need same border
</label>
<br/>
<span class="like-this">Not Selected</span>
<span class="like-this selected">Selected</span>