AddClass with jQuery target help needed
<p>I have a the following HTML</p>

<pre><code>&lt;fieldset&gt;
  &lt;legend&gt;
     &lt;input type="checkbox" class="myCheck"&gt;Click
  &lt;/legend&gt;
  content
&lt;fieldset&gt;
</code></pre>

<p>I'm trying to add class when the checkbox is selected and remove when unchecked. Should't something like this work:</p>

<pre><code>$(".myCheck").change(function() {           
    if ($(this).is(':checked')){
        $(this).parent("fieldset").addClass("myClass");
    } else {
        $(this).parent("fieldset").removeClass("myClass");
    }
});
</code></pre>

<p>What am I missing?</p>
