title: Class not being added with jQuery input check
body: <p>me again,</p>
  
  <p>Im using:</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
  $( document ).ready(function() {
      $('.check').submit(function() {
  
      var abort = false;
  
          $('.required').each(function() {
              if ($(this).val()==='') {
                $(this).addClass(' error');
                abort = true;
              }
          })
          return abort;
          })
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Example HTML</p>
  
  <pre><code>&lt;form class="check" style="font-family: Arial;" action="contact.php" method="post"&gt;
  &lt;input class="wipe required" style="font-family: Arial;" type="text" name="name" value="Full Name" /&gt;
  &lt;more input fields as above&gt;
  &lt;more input fields as above&gt;
  &lt;more input fields as above&gt;
  &lt;more input fields as above&gt;
  &lt;input class="right" style="font-family: Arial;" type="submit" value="SEND" /&gt;&lt;/form&gt;
  </code></pre>
  
  <p>which will be part of a larger form validation, however the error class isn't being added (despite not filling in the fields with a required class). The form just tries to submit - if i add event.preventDefault(); then the form doesn't submit but still the error class isn't added?</p>
  
  <p>The jQuery is added before the  tag</p>