0

I have some javascript that is for my login screen for this protected information but I want it to ask the person after being on the website for a certain amount of time for the password again.

      document.getElementById("forms").addEventListener("submit", 
       checkPswd, true);
                function checkPswd(){
                    var confirmPassword = "admin";
                    var password = 
                    document.getElementById("pswd").value;
                    if (password == confirmPassword){
                        window.location.href = "main.html";

                    }
                    else{
                        alert("Password is incorrect.");
                    }


                     //add prevent default
            event.preventDefault();
                }   
;

0 Answers0