title: Checkbox select using querySelectorAll is not working
body: <p>I have the following code, mostly from <a href="https://stackoverflow.com/questions/7791507/how-can-i-select-all-checkboxes-from-a-form-using-pure-javascript-without-js-fr">How can I select all checkboxes from a form using pure JavaScript</a> and it's just not working.</p>
  
  <p><strong>Test.html</strong></p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
      &lt;script&gt;
      function select(){
          var inputs = document.querySelectorAll("input[type='checkbox']");
          for(var i = 0; i &lt; inputs.length; i++) {
              inputs[i].checked = true;   
          }
      }
      &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form id="myId" name="myForm"&gt;
          &lt;input type="checkbox" value="1"/&gt; 1
          &lt;input type="checkbox" value="2"/&gt; 2
          &lt;input type="checkbox" value="3"/&gt; 3
          &lt;input type="button" onclick="select()"  value="Select all"/&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Clicking the button does nothing.
  I must be doing something really wrong here but I just can't pick it out.</p>