Numbers Game

So I’m just about to finish the numbers game, still a bit confused over how certain things work but hopefully that will come in time. I just want to know if there’s a cleaner or better way to create the alert function, I have written:

document.querySelector('#human-guess').onchange = numberGuess;
function numberGuess(e){
	if(e.target.value > 9){
		alert(`You can't enter a number over 9 and you entered ${e.target.value}`);
	}
}

Thanks in advance.

1 Like

Looks good! Although this might be a bit in your face with the window pop up :stuck_out_tongue: .