From 47e9712e70fbfb650e691978523706d35b906836 Mon Sep 17 00:00:00 2001 From: hikari Date: Mon, 28 Jun 2021 17:37:31 +0800 Subject: [PATCH] Fix not working on chrome. --- 4-typing-game/typing-game/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/4-typing-game/typing-game/README.md b/4-typing-game/typing-game/README.md index 6493e050..6d743324 100644 --- a/4-typing-game/typing-game/README.md +++ b/4-typing-game/typing-game/README.md @@ -216,7 +216,7 @@ document.getElementById('start').addEventListener('click', () => { // Convert into string and set as innerHTML on quote display quoteElement.innerHTML = spanWords.join(''); // Highlight the first word - quoteElement.childNodes[0].className = 'highlight'; + quoteElement.children[0].className = 'highlight'; // Clear any prior messages messageElement.innerText = ''; @@ -279,7 +279,7 @@ typedValueElement.addEventListener('input', () => { wordElement.className = ''; } // highlight the new word - quoteElement.childNodes[wordIndex].className = 'highlight'; + quoteElement.children[wordIndex].className = 'highlight'; } else if (currentWord.startsWith(typedValue)) { // currently correct // highlight the next word