title: Javascript code to select check boxes not working in IE8
body: <p>I've got the following code to that toggles selecting all checkboxes with a certain name.</p>
  
  <p>The code works great in webkit based browsers but doesn't work at all in IE8.</p>
  
  <p>Selecting toggle all, doesn't select anything.</p>
  
  <pre><code>&lt;label class="checkbox"&gt;
  
  &lt;input name="product" type="checkbox" id="7553" value="true" title="option1"&gt;
  option1
  &lt;/label&gt;
  
  &lt;label class="checkbox"&gt;
  
  &lt;input name="product" type="checkbox" id="65693" value="true" title="option2"&gt;
  option2
  &lt;/label&gt;
  
  &lt;label class="checkbox"&gt;
  &lt;input type="checkbox" onClick="toggle(this)"&gt;&lt;strong&gt;Select all&lt;/strong&gt;
  &lt;/label&gt;
  </code></pre>
  
  <p>Here's the JS</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function toggle(source) {
  checkboxes = document.getElementsByName('product');
  for(var i in checkboxes)
  checkboxes[i].checked = source.checked;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Can anyone see why the above doesn't work in IE8?</p>
  
  <p>Thanks</p>