title: onchange check password to be similar
body: <p>I have created a small fields for checking password to be similar like while writing confirm password it should verify whether the confirm password is similar or not I have created but it is not working can somebody help me out with this please.</p>
  
  <p>My code:</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 ppd() {
    var password = $("#password").val();
    var confirm_password = $("#confirm").val();
  
    if (password != confirm_password) {
      $("#confirm").css('border-color', "#c80000");
      $("#textboxid").css({
        "background-color": "#fee2e2"
      });
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="form-group"&gt;
    &lt;input type="password" id="password" name="" placeholder="Password" class="form-control" /&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
    &lt;input type="password" id="confirm" onChange="ppd();" name="" placeholder="Confirm Password" class="form-control" /&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><code>jQuery</code> Fiddle <a href="https://jsfiddle.net/fthsv936/" rel="nofollow noreferrer">Here</a></p>