Check password - Where is the error in code?
<p>The password authentication code, but does not work.. Where is the error in my code?</p>

<p><strong>JS:</strong></p>

<pre><code>function checkPass() {
var pass = document.getElementById('pass');
var pass2 = document.getElementById('pass2');

if(pass != pass2) {
document.layers.passResponse.innerHTML = "Passwords did not Match!";
} else {
document.layers.passResponse.innerHTML = "Passwords Match!";
}
}
</code></pre>

<p><strong>HTML:</strong></p>

<pre><code>&lt;div class="form-left"&gt;Password * &lt;/div&gt;
&lt;div class="form-right"&gt;&lt;input type="password" id="pass" name="pass" class="form-input" /&gt;&lt;/div&gt;
&lt;div class="form-left"&gt;Confirm Password *&lt;/div&gt;
&lt;div class="form-right"&gt;&lt;input type="password" id="pass2" name="pass2" class="form-input" /&gt;&lt;/div&gt;
</code></pre>
