Fix not working on chrome.

pull/298/head
hikari 4 years ago committed by GitHub
parent 4184773797
commit 47e9712e70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save