We're using a promo code to allow people access to a page. It doesn't have to be secure - just trying to give the customers a code prompt to make them feel special.
So I used this code... obviously I am doing something wrong because the browser keeps checking for the code even after they entered it (and eventually the page crashes). I tried break; at the end, but then prompt doesn't happen.
I would appreciate any help with this.
All I want to do is get rid of the endless loop here.
var secret;
while (secret !== "1")
if (secret !== "2")
if (secret !== "3")
if (secret !== "4") {
secret = prompt("What is the secret password?");
};