title: Validate email address on keyup with jQuery
body: <p>Im trying to validate an email address onkeyup only the following doesn't ever seem to return valid,</p>
  
  <p>Can anybody see where i may be going wrong? I only have 1 input and my <code>.first()</code> selector is targeting that correctly...</p>
  
  <pre><code>$('.newsletter-signup input').first().keyup(function(){
      $email = $('.newsletter-signup input').first();
       function validateEmail($email) {
        var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
        if( !emailReg.test( $email ) ) {
          alert('foo');
        } else {
          alert('bar');
        }
      }
  });
  </code></pre>