سلام و درود خدمت عزیزان
اقا توی این سوال مگه با توجه به صورت سوال ، استاد نگفتن که وقتی cancel هم میزنیم بگه canceled ?؟
ولی توی هیچکدوم از پاسخ ها ندیدم کنسل رو !!!!
من خودم توی همین مشکل دارم !!!
<script>
var user = prompt("Who's there?");
if (user == "Admin") {
var password = prompt("Password?");
if (password == "TheMaster") {
alert("Wellcome!");
} else if (password == null) {
alert("Canceled!");
} else {
alert("Wrong password!");
}
} else if (user == null) {
alert("canceled!");
} else {
alert("I don't know you!");
}
</script>
اینجا اگه کاربر cancel رو وارد کنه alert("canceled!") اجرا میشه’’