title: Unchecking all checkboxes having same class
body: <p>I have a script which checks all the checkboxes that have same class.</p>
  
  <p>However, I have put a condition of unchecking all of them which is not working.</p>
  
  <p>Here's my code</p>
  
  <pre><code>function check_all() {
      if ($('#all_check').prop("checked")) {
          $('.chk').prop("checked", "true");
      } else {
          $('.chk').prop("checked", "false");
      }
  }
  </code></pre>
  
  <p>The line <code>$('.chk').prop("checked", "false");</code> is having some problem, but what I can't find out.</p>
  
  <p>Only this section of the code is not working.</p>