title: jQuery - User name & Password matches then enable submit button
body: <p>I am using jQuery login...</p>
  
  <p>By default I am disabling "Submit" button. It will only enable if Email id matches to <code>info@company.com</code> and password matches to <code>hello</code></p>
  
  <p>But, as soon as I enter the correct email id and tab out, submit button is getting enabled.</p>
  
  <p><strong>I want to enable "submit" button only when User name and Password is entered correctly</strong></p>
  
  <blockquote>
    <p><strong><a href="http://jsfiddle.net/nc6NW/257/" rel="nofollow">Online Demo</a></strong></p>
  </blockquote>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>$('#validateUser input').keyup(function() {
    var userEmail = $('#userEmail').val();
    var userPassword = $('#userPassword').val();
    if( userEmail !== 'info@company.com' &amp;&amp; userPassword !== 'hello') {
      $('#loginSubmit').attr('disabled', true);
    } else {
      $('#loginSubmit').removeAttr('disabled');
    }
  });
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form action="dashboard.html" id="validateUser"&gt;
      &lt;div&gt;&lt;input type="text" id='userEmail' placeholder="Email ID"&gt;&lt;/div&gt;
      &lt;div&gt;&lt;input type="password" id='userPassword' placeholder="Password"&gt;&lt;/div&gt;
      &lt;button type="submit" id="loginSubmit" disabled&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>