title: checking all checkboxes jquery
body: <p>Why in my js code can just with one click on <code>name:check_all</code> checking all checkboxes?</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div id="ss"&gt;
      &lt;input type="checkbox" name="check_all"&gt;
  &lt;/div&gt;
  &lt;input type="checkbox" name="checked" class="idRow"&gt;
  &lt;input type="checkbox" name="checked" class="idRow"&gt;
  &lt;input type="checkbox" name="checked" class="idRow"&gt;
  &lt;input type="checkbox" name="checked" class="idRow"&gt;
  &lt;input type="checkbox" name="checked" class="idRow"&gt;
  &lt;input type="checkbox" name="checked" class="idRow"&gt;
  &lt;input type="checkbox" name="checked" class="idRow"&gt;
  &lt;input type="checkbox" name="checked" class="idRow"&gt;
  </code></pre>
  
  <p><strong>jQuery:</strong></p>
  
  <pre><code>$(document).on('click change','input[name="check_all"]',function() {
      var checkboxes = $('.idRow');
      if($(this).is(':checked')) {
          checkboxes.attr("checked" , true);
      } else {
          checkboxes.attr ( "checked" , false );
      }
  });
  </code></pre>
  
  <p><strong>DEMO:</strong> <a href="http://jsfiddle.net/KdaZr/">http://jsfiddle.net/KdaZr/</a></p>
  
  <p><strong>My jQuery version is 1.9.</strong></p>
  
  <p>How can fix it?</p>