Answers for "index.html:674 Uncaught TypeError: Cannot set property 'textContent' of null at showResult (index.html:674)"

1

index.html:674 Uncaught TypeError: Cannot set property 'textContent' of null at showResult (index.html:674)

function showResult(winner){
   let message ,messageColor;

   if(winner === YOU){
    message = 'You won!';
    messageColor = 'green';
    winSound.play();


   }else if (winner === DEALER){
     message = 'You lost!';
     messageColor = 'red';
     lossSound.play()


   }else {
    message = 'you drew';
    messageColor = 'black';


   }
   document.querySelector('#blackjack-result').textContent = message;
   document.querySelector('#blackjack-result').style.color = messageColor;
 }
Posted by: Guest on June-06-2021

Code answers related to "index.html:674 Uncaught TypeError: Cannot set property 'textContent' of null at showResult (index.html:674)"

Browse Popular Code Answers by Language