Design Interview 2

Make the checkbox labels activate the checkboxes when clicked.

by Ronen Hirsch

HTML

<!-- How would you make the checkboxes respond to clicking the labels next to them (so that you can click the checkbox as well as the text "Cats" or the text "Dogs")? You may add/change HTML, CSS and/or JS. 

To submit your answer, click "Fork" above and give us the URL. -->

<ul>
    <li>
        <input id="cat-box" type="checkbox" checked>
        <label for="cat-box">Cats</label>
    </li>
    <li>
        <input id="dog-box" type="checkbox">
        <label for="dog-box" >Dogs</label>
    </li>
</ul>

CSS

ul {
    margin: 0;
    padding: 0;
    list-style: none;
    }