title: Regex email validation on submit
body: <p>I want to do a very basic jQuery validation of an email via a regex on submit. My HTML:</p>
  
  <pre><code>&lt;form action="POST" id="form"&gt;
  &lt;input type="email" id="customer_email" placeholder="email here" /&gt;
  &lt;input type="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>$('#form').submit(function() {
  var email_reg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
  
  var emailinput = $('#customer_email').value();
  
  if (email_reg.test(emailinput) == false) {
      window.alert('no good');
  }
  });
  </code></pre>
  
  <p>To my understanding, for this to work I need to get the value of the input via email input (which I do on line 4) and run a regex on it. </p>
  
  <p>When submit is clicked, the standard input error appears on the form, and not the window alert. Feel free to view a Codepen outlining this here:
  <a href="http://codepen.io/anon/pen/oYmJLW?editors=1010" rel="nofollow noreferrer">http://codepen.io/anon/pen/oYmJLW?editors=1010</a></p>