title: If 4 specific checkboxes are selected, then unselect them and select only the "all items" one
body: <p>Now I have this form</p>
  
  <pre><code>&lt;ul&gt;
  &lt;li&gt;
      &lt;label&gt;
          &lt;input name="INTERESTS" type="checkbox" value="a" id="all"&gt;&lt;span&gt;All items&lt;/span&gt;
      &lt;/label&gt;  
  &lt;/li&gt;
  &lt;li&gt;
      &lt;label&gt;
          &lt;input name="INTERESTS" type="checkbox" value="b" id="1"&gt; &lt;span&gt;Item 1&lt;/span&gt;
      &lt;/label&gt;
  &lt;/li&gt;
  &lt;li&gt;
      &lt;label&gt;
          &lt;input name="INTERESTS" type="checkbox" value="c" id="2"&gt; &lt;span&gt;Item 2&lt;/span&gt;
      &lt;/label&gt;
  &lt;/li&gt;
  &lt;li&gt;
      &lt;label&gt;
          &lt;input name="INTERESTS" type="checkbox" value="d" id="3"&gt; &lt;span&gt;Item 3&lt;/span&gt;
      &lt;/label&gt;
  &lt;/li&gt;
  &lt;li&gt;
      &lt;label&gt;
          &lt;input name="INTERESTS" type="checkbox" value="e" id="4"&gt; &lt;span&gt;Item 4&lt;/span&gt;
      &lt;/label&gt;
  &lt;/li&gt;  
  &lt;/ul&gt;
  </code></pre>
  
  <p>And this javascript</p>
  
  <pre><code>var $others = $('input[name="INTERESTS"]').not('#all')
  $('#all').change(function () {
      if (this.checked) {
          $others.prop('checked', false)
      }
  });
  $others.change(function () {
      if (this.checked) {
          $('#all').prop('checked', false)
      }
  })
  </code></pre>
  
  <p><a href="https://jsfiddle.net/g3aqx31c/9/" rel="nofollow noreferrer">Test it at jsfiddle</a></p>
  
  <p>If the "all items" checkbox is selected then the others are unselected. It works great, but now I need that if all items are selected (Item 1 to Item 4), then unselect them and select only the "all items" checkbox. Any thoughts on this?</p>
  
  <p>Thanks!!!</p>