Currently, I am developing a game where once a player reaches 10 strikes, an alert should pop up saying "Game Over". However, the alert function is not working as expected. The StrikeNumber ID corresponds to the DIV that should trigger the alert once it hits the value of 10. This functionality is written in pure JavaScript.
function GameOver(){
if (document.getElementById('StrikeNumber').text === "10"){
alert("gameOVER");
}
}
HTML DIVS
<div id="StrikeNumber">
0
</div>
<div id="ScoreNumber">
0
</div>