dimanche 5 février 2017

Detecting multiple checked checkboxes

Without using JavaScript, I want something to happen only when two checkboxes are checked. So something like

#one:checked && #two:checked ~ p {
    color: red;
}

for

<input id="one" type="checkbox" name="check"><label for="one">One</label>
<input id="two" type="checkbox" name="check"><label for="two">Two</label>
<p>Thing</p>

which obviously doesn't work. Is there a way to detect both checkboxes without using JS?




Aucun commentaire:

Enregistrer un commentaire