title: Storing values from HTML Collection in array?
body: <p>I'm new to all this and I really need help.  I've been on this for hours now.<br>
  I have these checkboxes.  I'm using a cfoutput to generate them and giving them each the value of SID from the query.</p>
  
  <pre><code>&lt;cfoutput query="getvalues"&gt;
  &lt;div&gt;&lt;input type="checkbox" name="chk" id=#getvalues.SID# value=#getvalues.SID# class="chkbxs"&gt;
  &lt;/cfoutput&gt;
  &lt;input type="button" name="PrintSelected" value="Print Selected" onclick="printTextArea()"&gt;
  </code></pre>
  
  <p>The only thing I want to do is get the values of these checkboxes and store them in an array.  getElementsByClassName returns an html collection.  I've been told I need to loop over the html collection and then store the values in a new array which is what I attempted below but this isn't working.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    function printTextArea() {
      var myList = document.getElementsByClassName("chkbxs");
      var newList = [];
      for (var i = 0; i &lt; myList.length; i++) {
      newList.push(myList[i].value); 
      }
      for (var j = 0; j &lt; newList.length j++)
      {
      alert (newList[j]);
      }
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>Any help would be appreciated.  </p>