title: How to tell is a password is equal to another password?
body: <p>I'm programming a register form, but I want my visiters to enter their password twice. If they are the same, it's ok but if they aren't they get a pop-up or so. The form is in HTML and JavaScript. Heres my basic form (doesn't actually work, but it's basic.)</p>
  
  <pre><code>&lt;!doctype html&gt; 
       &lt;html&gt;
         &lt;head&gt;       
            &lt;title&gt;Register&lt;/title&gt; 
         &lt;/head&gt;      
         &lt;body&gt; 
             &lt;form&gt; 
                 &lt;fieldset&gt; 
                      &lt;label for="uName"&gt; 
                            Username:* 
                            &lt;input type="text" id="uName"  placeholder="Enter a username..." required&gt; 
                                 &lt;br&gt; 
                       &lt;/ label&gt; 
                      &lt;label for="email"&gt; 
                           Email:*    
                           &lt;input type="text" id="email"  placeholder="Enter your email..." required&gt;
                              &lt;br&gt; 
                      &lt;/label&gt; 
                      &lt;label for="password"&gt; 
                          Password:*      
                          &lt;input type="password" id="password" placeholder="Enter a password" required&gt;
                              &lt;br&gt; 
                       &lt;/label&gt; 
                       &lt;label for="password2"&gt; 
                          Reenter your    password:* 
                          &lt;input  type="password" id="password2" placeholder="Reenter your password..."&gt;
                              &lt;br&gt; 
                       &lt;/label&gt;           
                       &lt;input type="button"  value="Submit"   onClick="myFunction()"&gt;
                       &lt;script&gt;   
                            function myFunction() {
                                  var password = document.getElementById(password).value;     
                                 var password2 =  document.getElementById(password    2).value;   
                             }
                             if (password.value !     = password2.value) {      
                                  // do sth   alert("The passwords must   match"!); 
                              }  
                              }     
                         &lt;/script&gt; 
                   &lt;/fieldset&gt; 
              &lt;/form&gt;
          &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>Thanks for your answer!</p>
  
  <p>-MoosMas</p>