I am seeking to implement a text field where users can input a number, and based on whether it's correct or not, display "image a" for the correct answer and "image b" for an incorrect one below the text field. I want users to have multiple attempts until they get the right number. The only solution I've come across is this:
Apologies for the lack of expertise, folks!
var userNumber = prompt("Please enter a number", "");
document.write(userNumber);
if (isNaN(userNumber)) {
document.write("This is not a number");
} else {
document.write("This is a number");
}