This should work
<!DOCTYPE html>
<html>
<head>
<SCRIPT>
// Show Div if its hidden
function showdiv(){
// get the div
which = document.getElementById('adiv');
// show hide
if (!which)
return
else if (which.style.visibility=="hidden")
which.style.visibility="visible";
}
// Test User Credentials
function passWord(){
var testV = 1;
var pass1 = prompt('Enter The Code On Your Card Here.'); // no need to give a space here
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1.toLowerCase() == "abc123") {
showdiv()
alert("Redirecting in 3 secs...")
window.setTimeout(redirect,3000); //wait for 3 secs then redirect to card1.html
break;
}
testV+=1;
var pass1 = prompt('Access Denied - Password Incorrect, Please Try Again.',"password");
}
if (pass1.toLowerCase()!="password" & testV ==3)
history.go(-1);
return " ";
}
function redirect(){
window.open('card1e.html');
}
</SCRIPT>
</head>
<body>
<div id="adiv" style="font:24px bold; visibility:hidden">Now you see me</div>
<CENTER>
<input type="button" value="Click to enter credentials toe see the text block" onClick="passWord()">
</CENTER>
</body>