title: Javascript check all checkboxes with same ID
body: <p>I have the following</p>
  
  <pre><code>&lt;form class="form-inline" role="form"&gt;
      &lt;div class="col-xs-3"&gt;
          &lt;div class="pic-container"&gt;
  
                      &lt;label&gt;
                          &lt;span&gt;&lt;input type="checkbox" name="discounting" onchange='handleChange(this);' id='check11' value=""&gt;ciao&lt;/span&gt;&lt;br&gt;
                      &lt;/label&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-3"&gt;
          &lt;div class="pic-container"&gt;
  
                      &lt;label&gt;
                          &lt;span&gt;&lt;input type="checkbox" name="discounting" onchange='handleChange(this);' id='check21' value=""&gt;hola&lt;/span&gt;&lt;br&gt;
                      &lt;/label&gt;
                      &lt;label&gt;
                          &lt;span&gt;&lt;input type="checkbox" name="discounting" onchange='handleChange(this);' id='check21' value=""&gt;hola&lt;/span&gt;&lt;br&gt;
                      &lt;/label&gt;
                      &lt;label&gt;
                          &lt;span&gt;&lt;input type="checkbox" name="discounting" onchange='handleChange(this);' id='check21' value=""&gt;hola&lt;/span&gt;&lt;br&gt;
                      &lt;/label&gt;
                      &lt;label&gt;
                          &lt;span&gt;&lt;input type="checkbox" name="discounting" onchange='handleChange(this);' id='check21' value=""&gt;hola&lt;/span&gt;&lt;br&gt;
                      &lt;/label&gt;
                      &lt;label&gt;
                          &lt;span&gt;&lt;input type="checkbox" name="discounting" onchange='handleChange(this);' id='check21' value=""&gt;hola&lt;/span&gt;&lt;br&gt;
                      &lt;/label&gt;
                      &lt;label&gt;
                          &lt;span&gt;&lt;input type="checkbox" name="discounting" onchange='handleChange(this);' id='check21' value=""&gt;hola&lt;/span&gt;&lt;br&gt;
                      &lt;/label&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Id like by clicking the first check box that all check boxes in the second div with an ID of "check21" to be chacked automatically. </p>
  
  <pre><code>&lt;script&gt;
      function handleChange(cb) {
          if(cb.checked == true) {
             document.getElementById("check21").checked = true;
             alert('eyaicecold');
          } else {
             alert('Message 2');
             var x = document.getElementById("check21").disabled= false;
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I have used the following script which works but only for the first one. I wan to use the ids since the name and the value will be used to send the sql request  trough the form. </p>