The JavaScript instructions are shown below in bold.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>JavaScript Demo Example 13</title>
</head>
<body bgcolor="#FFFFFF"
onload="document.pwdrequest.pwd.value = '';document.pwdrequest.pwd.focus()"><!--note that
two single quotes surround the null value.-->
<h3>Simple password access to protected web pages. <a href="example_13_html.htm">View
source.</a></h3>
<center>
<form name="pwdrequest">
<p><b><font size="+1">Please enter the password and click on the "Log in"
button below.</font><br> (The password is "havefun" without the quotes.)</b></p>
<p><b>Password:</b>
<input type="password" name="pwd" size="12" maxlength="12"
onChange="window.location=document.pwdrequest.pwd.value + '/home.htm';"></p>
<input type="button" value="Log in" onClick="window.location=document.pwdrequest.pwd.value + '/home.htm';">
</form>
</center>

<p>&nbsp;</p>
<p><a href="index.htm">Return to Having Fun with JavaScript</a>.</p>

</body>
</html>

 

Return to Example 13.