Jquery to find more than one condition for items in a table
<p>Hi I have a table like:</p>

<pre><code>&lt;table class="approvalstable"&gt; 
  ... 
  &lt;tr&gt;
     &lt;td class="projectapproval"&gt; 
       &lt;img src="../../Content/Images/stock_lock.gif" alt="locked" class="lockicon invisibleforprint" /&gt; 
     &lt;/td&gt;
     &lt;td&gt;
        &lt;input type="checkbox" class="projectcheckbox approvalcheckbox" checked="checked" /&gt;
     &lt;/td&gt; 
  &lt;/tr&gt;
  &lt;tr&gt;
     &lt;td class="projectapproval"&gt; 
        &lt;img src="../../Content/Images/stock_lock.gif" alt="locked" class="lockicon invisibleforprint" /&gt;
     &lt;/td&gt;
     &lt;td&gt;
       &lt;input type="checkbox" class="projectcheckbox approvalcheckbox" /&gt;
     &lt;/td&gt; 
  &lt;/tr&gt;
  &lt;tr&gt;
     &lt;td class="projectapproval"&gt;
     &lt;/td&gt;
     &lt;td&gt;
       &lt;input type="checkbox" class="projectcheckbox approvalcheckbox" /&gt;
     &lt;/td&gt;
  &lt;/tr&gt; 
  ... 
&lt;/table&gt; 
</code></pre>

<p>So far to get the number of rows without lock images in them I have:</p>

<pre><code>$('.approvalstable td.projectapproval:not(:has(img.lockicon))').length
</code></pre>

<p>However I have a further requirement to only get the number of rows without lock images in them that also have a checked checkbox.</p>

<p>Ok so to get the number with checked checkboxes:</p>

<pre><code>$('.projectcheckbox:checked').length;
</code></pre>

<p>Can anyone tell me how to combine them though? I'm trying to get the number of rows that have both no lock images in a cell and a checked checkbox in a cell within the same row.</p>
