<html> <head> <script Language="JavaScript"> function passCheck(); { var myPass = document.getElementById("myPass"); i=0; while (myPass!=="Ofir") { i=i+1; } if (i>2) { alert("You have reached the attempts limit, Please try again later"); } else if (i<2) { alert("We do not recognize you, Please try again."); } } </script> </head> <body> <form method="Post"> <p>Password: <input type="text" id="myPass"></input></p> <input type="submit" onClick="passCheck()"></input> </form> </body> </html>
I've been trying to write a code that recieves a data (password), tho if the person has entered a wrong password
for over 2 times, he'll get an alert saying he's been banned for a few minutes..
I dont understand whats wrong with my script, please check this out and help me find a solution?
Thanks.
Im a begginer tho, just fyi.