title: Jquery/Javascript check input fields on keyboard touch
body: <p>I've been googling to get an answer, but i couldn't find what i want. Not sure if i typed my question wrong, but i'll try to explain.</p>
  
  <p>What i'm looking to achieve is : Once the user types, i want my script to run, so my button enables when the 2 passwords are equal to eachother. As soon as the passwords are equal to eachother, the button will be enabled. If not, the button will be disabled.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function test123() {
         var pw1 = $('#pw1').val();
         var pw2 = $('#pw2').val();
  
         if (pw1 == pw2) {
               console.log('Valid!');
           } else {
               console.log('Not valid!');
           }
  
           }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id='register-div'&gt;
         &lt;form method='POST' action='javascript:test123()'&gt;
             &lt;input name='username' type='text' placeholder='username'&gt;
             &lt;input id='pw1' name='password' type='password' placeholder='password'&gt;
             &lt;input id='pw2' name='password2' type='password' 
             placeholder='password_again'&gt;
             &lt;button type='submit'&gt;&lt;a&gt; REGISTER &lt;/a&gt;&lt;/button&gt;
     &lt;/form&gt;
     &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>