title: Check input with keyPress
body: <p>I have this js code, which checks my input field for correct email. </p>
  
  <pre><code>$(document).ready(function () {
  $('.subscription-form input').keypress(function () {
      var inputEmail = $('#email-subscribe');
      var email = inputEmail.val();
      var button =  $('.subscription-form button');
      console.log(email.length);
      if (IsEmail(email)) {
          button.prop('disabled', false);
          inputEmail.css({'border':'none'});
      }
      else if (email.length &lt; 1) {
          inputEmail.css({'border':'none'});
          console.log('enter');
      }
      else{
          button.prop('disabled', true);
          inputEmail.css({'border':'1px solid red'});
      }
  });
  });
  </code></pre>
  
  <p>Problem is that, when I write the correct email and then clear the input, my button is still active. I tried to check </p>
  
  <pre><code>if(input.email.length &lt; 0)
  </code></pre>
  
  <p>then disable the button, but it only works when there is one character.</p>
  
  <p>Please, help me to solve this problem.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form enctype="multipart/form-data" method="post" accept-charset="UTF-8"
                    action="/response.php"
                    class="text-center row subscription-form"&gt;
       &lt;div class="col-lg-10 col-md-10 col-sm-10 col-xs-12 col-lg-offset-1 col-md-offset-1 col-sm-offset-1"&gt;
       &lt;div id="output" class="col-lg-9 col-md-9 col-sm-8 col-xs-12"&gt;&lt;/div&gt;
       &lt;input id="email-subscribe" type="text" title="email" name="email"
                             placeholder="Enter your email*" class="col-lg-9 col-md-9 col-sm-8 col-xs-12 cnt-input"&gt;
             &lt;button disabled class="btn request getjob col-lg-2 col-md-8 col-sm-10 hidden-xs"&gt;Sign up&lt;/button&gt;
         &lt;div class="col-lg-2 col-md-8 col-sm-10 col-xs-12 visible-xs margi-top-10"&gt;
             &lt;button disabled class="btn request getjob"&gt;Sign up&lt;/button&gt;
         &lt;/div&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>