title: Javascript check / uncheck checkboxes based on id
body: <p>I have many server input checkboxes. I have given the first checkbox the id <code>all</code>. By default it will be checked. When the user checks other checkboxes, then checkbox with id <code>all</code> will be unchecked. And if <code>all</code> is checked other checkboxes will be unchecked. For this to happen i made the code but nothing is happening. </p>
  
  <p>Here is what i have tried.</p>
  
  <pre><code>&lt;form&gt;
  &lt;input type="checkbox" id="all" value="all" name="all" onChange="check()" checked/&gt;ALL &lt;br/&gt;
  &lt;input type="checkbox" id="servers" value="xampp" name="server[]" onChange="check()" /&gt;XAMPP &lt;br/&gt;
  &lt;input type="checkbox" id="servers" value="wamp" name="server[]" onChange="check()" /&gt;WAMP &lt;br/&gt;
  &lt;input type="checkbox" id="servers" value="mamp" name="server[]" onChange="check()" /&gt;MAMP &lt;br/&gt;
  &lt;input type="checkbox" id="servers" value="amp" name="server[]" onChange="check()" /&gt;AMP &lt;br/&gt;
  &lt;/form&gt;
  
  
  function check(){
      var all = document.getElementById("all"),
          group = document.getElementById("servers");
      if(all.checked == true){
          group.checked == false;
      }elseif(group.checked == true){
          all.checked == false;
      }
  }
  </code></pre>
  
  <p>I wanted my code to work like <a href="http://jsfiddle.net/heera/bGwrS/30/"><strong>THIS</strong></a>.</p>
  
  <p>I dont want to use jQuery for some reasons. So i need my code to be in pure JS.</p>
  
  <p>Any help will be appreciated.</p>