I'm writing some code to go at the begining of a webpage, which I want a prompt to show up asking visitors a couple of questions (after each question, either the prompt closes, or a new one opens based on the answer). I want the results of these prompts to be emailed to me. What could I do?
Example of my code:
var q = prompt("A five digit number?");
if (q.length === 5) {
var pTwo = prompt("Now a 2 digit number?");
if (pTwo.length === 2) {
document.write("thank you!");
} else {
document.write("Incorrect output");
}
} else {
var con = prompt("Are you sure?");
if (con === "yes") {
document.write("thank you anyways");
} else {
document.write("Refresh the page to respond.");
}
}