Password-protected webpage project:
Test 2.0
Password: forty-two
Code:
<html>
<script type="text/javascript">
function LogIn(){
var textBox = document.getElementById('TEXTBOX_ID');
textBox = textBox.value
if (textBox === "forty-two"){
window.location.replace("http://www.brychan.info/secret.html")
}
else {
alert ("Incorrect Password")
}
}
</script>
<body>
<style>
p {
margin-top: 0em;
margin-bottom: 0em;
font-size: 22px;
color: #339933;
}
h2 {
margin-bottom: 0em;
font-size: 30px;
color: #e60000;
}
</style>
<h2>Test 2.0</h2>
<p>Password: forty-two</p>
<input type="text" id="TEXTBOX_ID" style=width:125px;height:25px;font-size:17px;/>
<button onClick="LogIn()" style=height:25px;font-size:15px;>Log In</button>
</body>
</html>