The initial inquiry is effective. However, the subsequent one is encountering issues as it is failing to confirm if an email contains the "@" symbol.
My attempted solution involved reordering the functions related to email validation.
<body onload="check_user_age(); check_email" style="position:absolute">
<h1>Spirits Emporium</h1>
<script>
function check_user_age() {
if (age_of_user() < 18)
alert("You are not of legal age to purchase alcohol.");
}
function age_of_user() {
var age = prompt("Please provide your age:");
return age;
}
function check_email() {
if (email.includes("@"));
alert("Your email address is valid");
}
function email_of_user() {
var email = prompt("Kindly enter your email address:");
return email;
}
</script>
</body>