jQuery to bind click behavior to a collection of matching elements
<p>I'd like to add a jQuery handler for each of my checkbox inputs so that when their value is changed (via a click directly on them or via a click on the labels bound to them via the "for" attribute), to true (or checked="checked") a class called "selected" is added to the parent li element.</p>

<p>Conversely, when the checkbox is unchecked by a click event, I want to remove the "selected" class from the li element.</p>

<pre><code>&lt;li class="section"&gt;
    &lt;label class="left" for="my_ad_stacked"&gt;Left Label&lt;/label&gt;
    &lt;input type="checkbox" name="my_ad_stacked" id="my_ad_stacked" value="true"  /&gt;
    &lt;label for="my_ad_stacked" class="description check "&gt;label info goes here&lt;/label&gt;
&lt;/li&gt;
</code></pre>

<p>I know that If I know the id or class of an element, I can use $('myElement').addClass('selected') and $('myElement').removeClass('selected'). I'm just not certain how to attach the behavior, dynamically to all checkbox elements, and their "for" bound labels.</p>
