The first Prompt is working. The second is not working. the second function supposed to check if email contains @
I tried to switch the email function place
<body onload="check_user_age(); check_email" style="position:absolute">
<h1>Spiritueux Wines and Liquors</h1>
<script>
function check_user_age() {
if (age_of_user() < 18)
alert("You are too young to buy alcohol.");
}
function age_of_user() {
var age = prompt("What is your age?");
return age;
}
function check_email() {
if (email.includes("@"));
alert("Your email is correct");
}
function email_of_user() {
var email = prompt("what is your email");
return email;
}
</script>
</body>
check_emailifstatement, which causes thebodyof theifto be empty.