title: check all checkboxes using javascript is not working in IE
body: <p>I am trying to check all checkboxes by onclick event on a checkbox labeled 'Select All'.
  The code is working fine in FF,Chrome but not working in IE.
  The code is as below:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function toggle(source) {
  checkboxes = document.getElementsByName('category');
  for(var i in checkboxes)
   checkboxes[i].checked = source.checked;
  }
  &lt;/script&gt;
  
  &lt;input type="checkbox" name="selectAll" id="selectAll" onClick="javascript :toggle(this)" /&gt;Select All Categories
  
  &lt;input type="checkbox" name="category" id="category1" /&gt;category1
  &lt;input type="checkbox" name="category" id="category2" /&gt;category2
  &lt;input type="checkbox" name="category" id="category3" /&gt;category3
  </code></pre>
  
  <p>Any help would be appreciated.</p>