Any tips on how to write a JS function to check user input before posting to HTML page?
Using this so far:
document.onkeyup = function(event){
if (event.key >= 65 && event.key <=90){
guessesList.push(userChoice);
}
};
but doesn't seem to do anything when I refresh the page. The input needs to be only a letter, not a number or other input key.
match()to make sure only letters are passed by using a regex: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…