Find out if checkbox is checked using jQuery
<p>I've read lots of other posts on SO from people with the same problem, everything I have tried so far has not worked.</p>

<p>I have HTML like so:</p>

<pre><code>&lt;ul&gt;
  &lt;li class="templateList"&gt;
    &lt;input id="ctl00_MainContent_newCollection_wzd_lstSiteTypes_ctr10_chkSite" type="checkbox" checked="checked" name="ctl00$MainContent$newCollection$wzd$SiteTypes$ctrl0$chkSite"&gt;
    &lt;div&gt;&lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
     ...
  &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>Using jQuery I need to find all the checkboxes in the UL that are checked, then add a CSS class to the LI parent element called "selected".  This is what I have so far:</p>

<pre><code>    $(".templateList input:checkbox").each(function () {
        var chk = $(this);
        alert($(chk).attr("checked"));
        if (chk.attr("checked")) {
            ... do something ...
        }
    });
</code></pre>

<p>The alert satement is for debug - it always says "undefined".</p>

<p>This is so simple but is driving me nuts!</p>
