The password is entered through the text if the password is incorrect, then delete body and "the password is not correct" if correct, then "the password is correct"
function checkPass(input) { if (input.value == "123456") { alert("the password is correct!") } else { alert("the password is not correct!") document.body.innerHTML = ""; } }