title: Error: Cannot read property 'checked' of undefined
body: <p>I'm trying to store the result of checked checkboxes in local storage but when I try to save I get the error mentioned above. </p>
  
  <p>Not quite sure what is undefined since I see the property in my code. 
  Here's the code:</p>
  
  <pre><code>var getCheckboxValue = function (){
      var checkboxes = document.forms[0].features;
      for(var i=0, j=checkboxes.length; i&lt;j; i++){
          if(checkboxes[i].checked){
          console.log(checkboxes[i].value);
              //featuresValue = $("features").value();
          }else{
              checkboxes = "No"
          }
          }
      }
  
  var storeData = function (){
      var id = Math.floor(Math.random()*10000001);
      //getSelectedRadio();
      getCheckboxValue();
      var item = {};
          item.brand = ["Brand",$("brand").value];
          item.model = ["Model",$("model").value];
          item.comments = ["comments",$("comments").value];
          //item.acoustic = ["acoustic", acousticValue]; 
          item.features = ["features",checkboxes];
  
      //Save data into local storage: Use Stringify to convert our object to a string
      localStorage.setItem(id,JSON.stringify(item));
      alert("Contact Saved!");
  }
  
  
  //set link &amp; submit click events
  var save = $("button");
  save.addEventListener("click", storeData);
  </code></pre>
  
  <p>and here's the relevant html:</p>
  
  <pre><code>&lt;li&gt;Features:
                      &lt;ul&gt;
                          &lt;li&gt;&lt;input type="checkbox"  name="features" value = "Cutaway" id="cutaway" /&gt;&lt;label for="cutaway"&gt;Cutaway&lt;/label&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;input type="checkbox"  name="features" value = "Finished" id="finished" /&gt;&lt;label for="finished"&gt;Finished&lt;/label&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;input type="checkbox"  name="features" value = "Inlay" id="inlay" /&gt;&lt;label for="inlay"&gt;Inlay&lt;/label&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;input type="checkbox"  name="features" value = "Wide Neck" id="wneck" /&gt;&lt;label for="wneck"&gt;Wide Neck&lt;/label&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;input type="checkbox"  name="features" value = "Left-handed" id="lhanded" /&gt;&lt;label for="lhanded"&gt;Left-handed&lt;/label&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/li&gt;
  </code></pre>
  
  <p>Alternatively, here's a link to the full code on github:</p>
  
  <p><a href="https://github.com/b80266/VFW-Project-2/blob/master/additem.html" rel="nofollow">https://github.com/b80266/VFW-Project-2/blob/master/additem.html</a></p>
  
  <p><a href="https://github.com/b80266/VFW-Project-2/blob/master/main.js" rel="nofollow">https://github.com/b80266/VFW-Project-2/blob/master/main.js</a></p>