title: How to get the selected checkbox value?
body: <p>I am trying to get the selected checkboxes value and the hidden field value next to it when user submits the form. </p>
  
  <pre><code>&lt;form....&gt;
  
  &lt;td&gt;&lt;input type='checkbox' name='checkbox' value='1' &gt;&lt;/input&gt;&lt;/td&gt;
  &lt;input type='hidden' name='sid1' value='1'/&gt;
  
  &lt;td&gt;&lt;input type='checkbox' name='checkbox' value='1' &gt;&lt;/input&gt;&lt;/td&gt;
  &lt;input type='hidden' name='sid2' value='2'/&gt;
  
  &lt;td&gt;&lt;input type='checkbox' name='checkbox' value='1' &gt;&lt;/input&gt;&lt;/td&gt;
  &lt;input type='hidden' name='sid3' value='3'/&gt;
  </code></pre>
  
  <p>I try:</p>
  
  <pre><code>$(document).ready(function(){
      if( $("input[name='checkbox']['checked']")) {
          $("input[name='checkbox']['checked']").each(function(){ 
              var test=$(this).val();
              alert(test);    
          })
      }
  })
  </code></pre>
  
  <p>but it will gives me all the checkbox value even thought they were not checked. Any one could help me about this? Thanks a lot!</p>