I'm a noob that needs some help with his HTML, thanks everyone?

  • Thread starter Thread starter Andrew3042
  • Start date Start date
A

Andrew3042

Guest
Ok where In here would I put something so that if i type the password wrong the first and second time it will ask me to type it agin but on the 3rd time, the page would close. Thanks very much I do appreciate all your help as I am a HTML noob lol thanks again and have great christmas.

<html>

<head>

</head>

<body>

<script type="text/javascript">

var password="password";

function check(input)
{
if(input == password)
document.write("Well Done");

else
alert("Wrong Password, TRY AGAIN!");

}

</script>
</head>

<body>

<input id="pass" type="password">
<input type="Submit" onclick="check(pass.value)">



</body>
</html>

Now i tried this, but it says it wants to close the webpage, it gives me the option.

<html>

<head>

</head>

<body>

<script type="text/javascript">
var Counter=0;
var password="password";

function check(input)
{
Counter = Counter+1;
if ( Counter == 3)
{
window.close();
}
if(input == password)
document.write("Well Done");

else
alert("Wrong Password, TRY AGAIN!");

}

</script>
</head>

<body>

<input id="pass" type="password">
<input type="Submit" onclick="check(pass.value)">



</body>
</html>

it is good, thanks everyone, as i said im a noob! Merry Christmas!
 
Back
Top