diff --git a/morse-code_files/morse-code.js b/morse-code_files/morse-code.js index 32a946d..bf2fad7 100644 --- a/morse-code_files/morse-code.js +++ b/morse-code_files/morse-code.js @@ -294,7 +294,7 @@ class ListeningGame { } else { const enteredWord = this.wordInput.value; // console.log('enteredWord: ', enteredWord, 'target: ', this.target); - if (enteredWord.toUpperCase() == this.target.toUpperCase()) { + if (enteredWord.trim().toUpperCase() == this.target.trim().toUpperCase()) { // If they got the word, show message and switch event listener. this.statusElement.textContent = 'Correct! Press enter to play a new round.'; this.messageFound = true;