title: How to get the number (count) of selected checkboxes?
body: <p>I have following code</p>
  
  <pre><code>&lt;ul class="myfilterside  catfilter"&gt;
  &lt;li&gt;
      &lt;input type="checkbox"  value="1" class="filter" name="Bedroom"&gt;
      &lt;a id="1" href="javascript:void(0)" class="filter1"&gt; test1 &lt;/a&gt;
  &lt;/li&gt;
  
  &lt;li&gt;
      &lt;input type="checkbox"  value="2" class="filter" name="Corridor"&gt;
      &lt;a id="2" href="javascript:void(0)" class="filter1"&gt; test2 &lt;/a&gt;
  &lt;/li&gt;
  
  &lt;li&gt;
      &lt;input type="checkbox"  value="3" class="filter" name="Test"&gt;
      &lt;a id="3" href="javascript:void(0)" class="filter1"&gt; test3 &lt;/a&gt;
  &lt;/li&gt;
  
  &lt;/ul&gt;
  &lt;input type="button" value="Clear All" class="check"&gt;
  &lt;script&gt;
  jQuery('.check:button').click(function(){ 
              jQuery('.filter').removeAttr('checked');                    
              jQuery(this).val('Clear All');              
          }); 
  &lt;/script&gt;       
  </code></pre>
  
  <p>On clicking the button I want to get the count of all selected checkboxes. That means if two checkboxes are checked the I want to get the count =2
  How can I do this?</p>