function pass(){ var pw = prompt("Please Password"); if (pw == "@rise"){ alert("OK"); } else { alert("NO"); //location.href = "../index.html"; } }