how to create webpage password protected in javascript


step: 1 create on webpage as html file

step: 2 in head tage add coding like,

<script>
    var password="typepassword";
    password=prompt("Please Enter The Password To Enter
This Site");
    if(password!="typepassword"){
        location.href="http://127.0.0.1:5500/webpage.html";
    }
    </script>

step: 3 above code match password exact word redirect on webpages

step: 4 run on file

Post a Comment

0 Comments