My Validation is not working as i want it to when click submit with an empty field. Instead of displaying the message ''Please enter a number between 1 and 10, it shows the message ''NaN is not correct, 2 guesses left''
Any help would be much appreciated!
/ Listen for guess guessBtn.addEventListener('click', function(){ let guess = parseInt(guessInput.value);enter code here
// Validate input if (isNaN(guess) || guess < min || guess > menter code here
ax){ setMessage(Please enter a number between ${min} and ${max}
, 'red'); }
Aucun commentaire:
Enregistrer un commentaire