How do you check for whether a checkbox is checked or not checked?
<p>I thought this would work:</p>

<pre><code>if ($(this).attr('checked')) {}
</code></pre>

<p>but I had to write it this way:</p>

<pre><code>if ($(this).is(':checked')) {}
</code></pre>

<p>Q: Why?</p>
