title: Compare two Strings in javascript, obtained from a form element using jQuery
body: <p>I want to compare two strings in jQuery, which is very easy, but I get all the time 'yes' in the console, doesn't matter if the passwords are the same or different, any ideas? Thanks! </p>
  
  <pre><code>ns.resetPassword = function(){
      var password1 = $.trim($('#password1').val());
      console.log(password1);
      var password2 = $.trim($('#password2').val());
      console.log(password2);
  
      if(password1==password2){
        console.log('yes!');
      }else{
        console.log('different!');
      }
    }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input class="form-text" id="password1" name="password.password1" type="password" maxlength="128" size="60" placeholder="@Messages("securesocial.passwordChange.newPassword1")"&gt;
  
  &lt;input class="form-text" id="password2" name="password.password2" type="password" maxlength="128" size="60" placeholder="@Messages("securesocial.passwordChange.newPassword2")"&gt;
  </code></pre>
  
  <p>I changed the id from password.password1 to password1 as some of you suggested</p>