Check password - Where is the error in code?

前端 未结 3 695
伪装坚强ぢ
伪装坚强ぢ 2021-01-28 08:06

The password authentication code, but does not work.. Where is the error in my code?

JS:

function checkPass() {
var pass = document.getE         


        
3条回答
  •  再見小時候
    2021-01-28 08:19

    You are compare two html elements, not the values of them.

    if(pass1 != pass2) {

    Should be

    if(pass1.value != pass2.value) {
    

提交回复
热议问题