use textContent rather than innerText
This commit is contained in:
parent
3eb7ff7bae
commit
4d1b375c35
2 changed files with 4 additions and 4 deletions
|
@ -17,14 +17,14 @@ function changeWord() {
|
|||
var newWord;
|
||||
do {
|
||||
newWord = randomChoice(wordList);
|
||||
} while (newWord === wordEl.innerText);
|
||||
} while (newWord === wordEl.textContent);
|
||||
|
||||
var newColor;
|
||||
do {
|
||||
newColor = randomChoice(colors);
|
||||
} while (newColor === wordEl.style.color);
|
||||
|
||||
wordEl.innerText = newWord;
|
||||
wordEl.textContent = newWord;
|
||||
wordEl.style.color = newColor;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue