I want it asked "What is your age?" If the age is < 21 I want the alert that follows and the page to close right after. In this case it still brings up the "Age doesn't match" alert. Been coding for 1.5 hrs, don't make fun of me.
var age = prompt("What is your age?");
if (age < 21) {
alert("Access denied"); window.close();
}
if (age == 21) {
alert("Just made it");
}
if (age > 21) {
alert("Welcome aboard");
}
// Confirm
if (age >= 21) {
var ageconfirm = prompt("Again?");
}
if (age==ageconfirm) {
alert("Just checkin'")
}
if (age != ageconfirm) {alert("Age doesn't match");
}
if (ageconfirm <21) { window.close();
}