+ 2
Need help
Hey guys.Today I want to create password for my website,example if you enter website,it will ask you to enter password.I know,it is not necessary,but I want go deeper parts of JavaScript. I need something that if entered password is wrong,it asks back again for correct password.I already made 70% of code,so need help for rest of 30%.Hope you will get my point.Thanks https://code.sololearn.com/WG3bmAv94Z8r/?ref=app
9 Respostas
+ 4
window.onload = function(){
var pw = prompt("please insert password");
while(pw !== "Elshad")
{
alert("false password try again");
pw = prompt("please insert password");
if(pw === "Elshad")
{
alert("Nice, Bro");
}
}
}
+ 4
var x = prompt("Enter password:");
if(x == "yourPassword"){
alert("Accepted");
}
else {
alert("Try again");
}
Edit: add this
while (x != "yourPassword"){
prompt("Enter your Password:");
}
+ 4
This is a way... Otherwise no gained access
https://code.sololearn.com/Wkbf5G4EX168/?ref=app
+ 3
Yes
+ 3
Did you get my point?Can you make it?If someone help me with it,maybe we can lock our website :)
+ 3
This is infinite...
+ 2
Iwan look at my code,I already did it.Thanks anyway,but I need that Noone can access my website unless they enters valid password.Hope you will get my point.
+ 2
Thanks everyone brothers!
+ 2
Thanks @Iwan and @Max_N!I will credit both of you in my code!