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

Tell us what’s happening:

I tried changing the winnerMsgElement.innerText accordingly to determine if there’s a winner, but I’m encountering an error. I don’t understand where the error came from.

Your code so far

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

/* file: styles.css */

/* 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 === 3 || computerScore === 3) {
    if (playerScore > computerScore) {
      winnerMsgElement.innerText = "Player has won the game!";
      resetGameBtn.innerText = el.style.display;
    }
    if (playerScore < computerScore) {
      winnerMsgElement.innerText = "Computer has won the game!";
      resetGameBtn.innerText = el.style.display;
    }
  }
};

// User Editable Region

Your browser information:

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

Challenge Information:

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

Have you hidden the optionsContainer as guided? Read the instruction carefully and try to hide the container according to the it.
Hoping you find your solution.

I was just confused, but I figured it out.

1 Like

You used the property incorrectly to show the reset button