title: jQuery - Count number of checked checkboxes with a given Id value
body: <p>I have a page with a table on it. Two of the columns in the table are checkbox columns. Each has a different Id value. I'm trying to count, via jQuery, the number of rows in the table where one of the checkbox columns (which has an Id value of 'InChecklist') is checked. My JS function looks as follows:</p>
  
  <pre><code>function UpdateCount() {
      var totalRows = $('#checklistTable tbody tr:visible').length;
      var totalSeen = $(":input#InChecklist[checked='checked']").length;
      $("#rowCount").text(totalRows.toString() + " species / " + totalSeen + " seen")
  }
  </code></pre>
  
  <p>The total row count is fine. But I must not have the syntax correct for the total seen because I cannot get it to count correctly (the value is always zero). If I remove the '#InChecklist', I do get a value greater than zero, but in this case, it's counting the total checked in both checkbox columns, not the one with an Id of 'InChecklist'.</p>
  
  <p>If it helps, the portion of my HTML that renders the checkboxes look as follows. It's MVC5.</p>
  
  <pre><code>        &lt;td&gt;
              &lt;input id="InChecklist" name="item.HasBeenSeenChecklist" type="checkbox" value="true" /&gt;&lt;input name="item.HasBeenSeenChecklist" type="hidden" value="false" /&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;input id="InLifelist" name="item.HasBeenSeenLifelist" type="checkbox" value="true" /&gt;&lt;input name="item.HasBeenSeenLifelist" type="hidden" value="false" /&gt;
          &lt;/td&gt;
  </code></pre>