Skip to content

Commit 67e6761

Browse files
Replaced innerText with textContent
1 parent cd4aefa commit 67e6761

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

DiceGame/script.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ var img2 = document.querySelector(".img2").setAttribute("src",randomDiceImage2);
1010

1111
var winnerDeclaration = document.querySelector("h1");
1212
if(randomNo>randomNo2){
13-
winnerDeclaration.innerHTML="🚩Player 1 is the winner!"
13+
winnerDeclaration.textContent="🚩Player 1 is the winner!"
1414
}
1515
else if(randomNo<randomNo2){
16-
winnerDeclaration.innerText="Player 2 is the winner🚩!"
16+
winnerDeclaration.textContent="Player 2 is the winner🚩!"
1717
}
1818
else{
19-
winnerDeclaration.innerText="Try again!"
19+
winnerDeclaration.textContent="Try again!"
2020
}

0 commit comments

Comments
 (0)