jeudi 27 décembre 2018

How to fix this JavaScript if-statement? [on hold]

My Question is about if statements. There is an if statement where you have to type in a password, and it would then verify whether that is the real password.

if(pass == "Hello") {
    window.alert("Welcome Purple!")
}
else {
    window.alert("INVALID PASSWORD")
}

(Pass is a document variable, taken from an input.)

After I typed in Hello in the input, it ran the else statement, instead of the if statement.

Can anyone tell me why this happens?

Aucun commentaire:

Enregistrer un commentaire