Password Protecting a Page
<HTML>
<HEAD>
<TITLE>
Test that password
</TITLE>
</HEAD>
<BODY>
<SCRIPT>
var password = "";
password=prompt("Please enter your password!","");
if (password != null) {
location.href= "http://www.java2s.com";
}
</SCRIPT>
</BODY>
</HTML>
Related examples in the same category