Review DOM Manipulation by Building a Rock, Paper, Scissors Game - Step 5

Tell us what’s happening:

Sorry, your code does not pass. Try again.

You should update the winnerMsgElement if there is a winner.

Your code so far

<!-- file: index.html -->

/* file: script.js */
// User Editable Region

```const playerScoreSpanElement = document.getElementById("player-score");
const computerScoreSpanElement = document.getElementById("computer-score");
const roundResultsMsg = document.getElementById("results-msg");
const winnerMsgElement = document.getElementById("winner-msg");
const optionsContainer = document.querySelector(".options-container");
const resetGameBtn = document.getElementById("reset-game-btn");

function showResults(userOption) {
  roundResultsMsg.innerText = getRoundResults(userOption);
  computerScoreSpanElement.innerText = computerScore;
  playerScoreSpanElement.innerText = playerScore;

  if (playerScore === 5 || computerScore === 5) {
   
    winnerMsgElement.innerText = playerScore === 5 
      ? "Player has won the game!" 
      : "Computer has won the game!";

    winnerMsgElement.style.display = "block"; 
    optionsContainer.style.display = "none"; 
    resetGameBtn.style.display = "block";    
  } else {
    winnerMsgElement.style.display = "none"; 
  }
}```


// User Editable Region
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Review DOM Manipulation by Building a Rock, Paper, Scissors Game - Step 5

Hi there!

The instructions is asking you: you will need to check if the player or computer has reached three points. If either has reached three points, you should display a message indicating the winner.

You are added 5 points for comparing the result instead.