Help Needed: Trying to Create a Password Validation Website
<script language="Javascript">
function checkPassword(x){
if (x == "HI"){
alert("Just Press Ok to Continue...");
} else {
alert("Nope... not gonna happen");
}
}
var grape = alert("Just press Ok to Countinue...")
function redirectToWebsite() {
if (grape === true){
window.location="http://www.google.com";
} else {
alert("Nope... not gonna happen")
}
}
}
</script>
<center>
<br /><h3>Please Enter the Password</h3>
<br />
<b>Password:</b>
<input type="password" id="pass" value="">
<br /><br />
<button onclick="javascript:checkPassword(document.getElementById('pass').value)">Check Password</button>
<button onclick="javascript:redirectToWebsite">Proceed To my Website</button>
I would appreciate any help as I am still learning JavaScript and prefer not to use PHP. Thank you!