title: How to get the count of checked rows of a table on a button click using jQuery?
body: <p>I'm working with Asp .net MVC3 following is my table,</p>
  
  <pre><code>  &lt;table id="myIndiaTable"&gt;
       &lt;thead&gt;
        &lt;tr&gt;
        &lt;th&gt;Select All&lt;input type="checkbox" class="chkhead" onchange="Getchecked()"/&gt;&lt;/th&gt;
        &lt;th&gt;ID&lt;/th&gt;
        &lt;th&gt;Name&lt;/th&gt;
        &lt;/tr&gt;
       &lt;/thead&gt;
       &lt;tbody&gt;
        &lt;tr&gt;
        &lt;td&gt;&lt;input type="checkbox" class="chkdata"/&gt;&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;xxx&lt;/td&gt;
       &lt;/tr&gt;
        &lt;tr&gt;
        &lt;td&gt;&lt;input type="checkbox" class="chkdata"/&gt;&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;yyytd&gt;
       &lt;/tr&gt;
        &lt;tr&gt;
        &lt;td&gt;&lt;input type="checkbox" class="chkdata"/&gt;&lt;/td&gt;
        &lt;td&gt;3&lt;/td&gt;
        &lt;td&gt;zzz&lt;/td&gt;
       &lt;/tr&gt; 
       &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;div class="btn"&gt;
   &lt;input type="button" name = "Submit" value ="Submit" onclick ="GetValues()"/&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>When I click the submit button I have to get the count of selected rows count as an alert. How can I get this using jQuery?</p>