0

Can you please help me? How can I in css reach .switch if input is checked? I googled and tried this: (I basically want to change background if is input:checked)

.switch:has(>input:checked) {
  background-color: #fff;
}

but it didnt worked.

<label class="switch">
<input type="checkbox"">
<div class="slider"></div>
</label>

I know that there could be some way to do it in js, but is there way in css?

Thank you so much guys.

ochj1ch
  • 73
  • 1
  • 7

0 Answers0