I need help with a specific type of HTML code
<div class='box'>
<input type="checkbox" id="c1">
<label for="c1">Check me to hide</label>
</div>
<div id='con-1'>Div to hide when checked</div>
I'm looking to hide the div with id con-1
when the checkbox with id c1
is checked. However, I'm having trouble finding the correct selector to achieve this.
Disclaimer: I am unable to alter the existing HTML structure and cannot use JavaScript or jQuery.
You can experiment with the code live here: http://jsbin.com/xapaweqoju/edit?html,css,output