title: jquery make alert equal to an array of names
body: <p>This code above looks to see if my check boxes are checked or unchecked. IF they are unchecked then it logs in the console the names of the checkboxes that are unchecked. I want to take those names and put them in the alert box and am struggling to access the element.name outside the each loop. Anyone have any ideas?</p>
  <pre class="lang-js prettyprint-override"><code>// when page is ready
  jQuery(&quot;#user_price_accept&quot;).submit(function(event) {
    // on form submit
    event.preventDefault();
    var test = jQuery(this).find('input[type=checkbox]:not(:checked)')
    var test2 = '';
    test.each((i, element) =&gt; {
      console.log(element.name)
      test2 = element.name;
    })
    return test2;
    if (test.length &gt; 0) {
      alert(test2);
    }
  });
  </code></pre>