title: why cant my checkbox be checked by id
body: <p>my checkbox does not want to check by id, it only allows it to be checked by name. Here is the code:</p>
  
  <pre><code>function selectAll(){
      var checkboxes = document.getElementsByName('id');
      var button = document.getElementById('toggle');
      if(button.value == ''){
          for (var i in checkboxes){
              checkboxes[i].checked = 'FALSE';
          }
          button.value = 'X'
      } else {
          for (var i in checkboxes){
              checkboxes[i].checked = '';
          }
          button.value = '';
      }
  }
  </code></pre>
  
  <p>Why cant my checkbox be checked by id?</p>