title: How to add 2 rule to a jQuery if statement
body: <p>I am not the best at jQuery. hoping someone can help with a small issue I am having. I have a password validation script and is trying to add 2 rules to a if statement but it is no working. below is my code.</p>
  
  <pre><code>function validatePassword() {
  var password = $("#password").val();
  var confirmPassword = $("#conf_password").val();
  
  if (password != confirmPassword)
      $("#validate_pass ").empty().append("Passwords do not match!").removeClass("alert-    
  success").addClass("alert-error");
  else
      $("#validate_pass").empty().append("Passwords match.").addClass("alert-success");
  }
  
  $(document).ready(function () {
  $("#conf_password").keyup(validatePassword);
  });
  </code></pre>
  
  <p>This works great. I am trying to hide the submit button in the form using  $(".btn-save").hide(); . if I place this after here it breaks the function.</p>
  
  <pre><code>    if (password != confirmPassword)
      $("#validate_pass ").empty().append("Passwords do not match!").removeClass("alert-    
      success").addClass("alert-error");
   $(".btn-save").hide();
    else
  </code></pre>