Password Protecting a Page : Password « Form Control « JavaScript DHTML






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

1.Password field size
2.Get text input max Length
3.Methods and Properties of the Password Object
4.Demonstrates password field and hiden field