title: jquery check-uncheck checkbox
body: <p>When I click on Problem, both check boxes must select/deselect. I want to select and deselect check boxes for multiple time. It works only for selecting and then deselecting (2 times) and then is not working any more.</p>
  
  <p><img src="https://i.stack.imgur.com/z0G0c.png" alt="check boxes"></p>
  
  <p>My code: </p>
  
  <pre><code> $(document).ready(function() {
          $('#CHECK-ALL').click(function() {
              if ($(this).is(':checked')) {
                  $('#P').attr('checked',true);                
              } else {
                  $('#P').attr('checked',false);                
              }
          });
      });
  </code></pre>