title: How to uncheck select all checkbox when any one of their child got deselected
body: <p>How can I uncheck the select all <code>checkbox(parent)</code>, when any one of their child checkboxes are deselected!</p>
  
  <p>From the snippet when we select all checkbox and when we deselect users from their then select all checkbox should be unchecked (Because all checkboxes are not selected)</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $('#Admin').click(function() {
      var checked = $(this).prop('checked');
      $('#tab-10').find('input:checkbox').prop('checked', checked);
    });
  
    $('#Sales').click(function() {
      var checked = $(this).prop('checked');
      $('#tab-20').find('input:checkbox').prop('checked', checked);
    });  
      // i have so may like this in that case how can i do that.?
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;ul class="nav nav-tabs"&gt;
    &lt;li class="active"&gt;&lt;a data-toggle="tab" href="#tab-10"&gt; First &lt;/a&gt;&lt;/li&gt;
    &lt;li class=""&gt;&lt;a data-toggle="tab" href="#tab-20"&gt; Second &lt;/a&gt;&lt;/li&gt;
  
  &lt;/ul&gt;
  
  &lt;div class="tab-content vehicle"&gt;
    &lt;div id="tab-10" class="tab-pane active"&gt;
      &lt;div class="panel-body"&gt;
        &lt;div class="row"&gt;
          &lt;div class="col-md-3"&gt;
            &lt;div class="checkbox"&gt;
              &lt;label&gt;&lt;input type="checkbox" id="Admin"&gt;&lt;b&gt;Select All&lt;/b&gt;&lt;/label&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="col-md-3"&gt;
            &lt;div class="checkbox"&gt;
              &lt;label&gt;&lt;input type="checkbox" name="pages[]" value="2"&gt;Dealerships&lt;/label&gt;
            &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="col-md-3"&gt;
            &lt;div class="checkbox"&gt;
              &lt;label&gt;&lt;input type="checkbox" name="pages[]" value="23"&gt;Users&lt;/label&gt;
            &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="col-md-3"&gt;
            &lt;div class="checkbox"&gt;
              &lt;label&gt;&lt;input type="checkbox" name="pages[]" value="59"&gt;Third-Party Exports&lt;/label&gt;
            &lt;/div&gt;
          &lt;/div&gt;
  
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    
  &lt;br&gt;&lt;br&gt;
  
  &lt;div id="tab-20" class="tab-pane "&gt;
   &lt;div class="panel-body"&gt;
    &lt;div class="row"&gt;
     &lt;div class="col-md-3"&gt;
      &lt;div class="checkbox"&gt;
       &lt;label&gt;&lt;input type="checkbox" id="Sales"/&gt;&lt;b&gt;Select All&lt;/b&gt;&lt;/label&gt;
      &lt;/div&gt;
     &lt;/div&gt;
     &lt;div class="col-md-3"&gt;
      &lt;div class="checkbox"&gt;
       &lt;label&gt;&lt;input type="checkbox" name="Second[]" value="2"&gt;Second tab 1&lt;/label&gt;
      &lt;/div&gt;
     &lt;/div&gt;
     
     &lt;div class="col-md-3"&gt;
      &lt;div class="checkbox"&gt;
       &lt;label&gt;&lt;input type="checkbox" name="Second[]" value="23"&gt;Second tab 1&lt;/label&gt;
      &lt;/div&gt;
     &lt;/div&gt;
    &lt;/div&gt;
   &lt;/div&gt;
  &lt;/div&gt;
  
    
    
    
    
    
    
    
    
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>