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

Tell us what’s happening:

Task is to create winner of game message ,hide optionsContainer and show resetGmeBtn.What is wrong?

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){winnerMsgElement="Player has won the game!";
  optionsContainer="hide";
  resetGameBtn="show"}
  if(computerScore=3){winnerMsgElement="Computer has won the game!";
  optionsContainer="hide";
  resetGameBtn="show"}


};

// 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/132.0.0.0 Safari/537.36 Edg/132.0.0.0

Challenge Information:

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

Hi.

You need 2 conditions for each of your conditions on the if statement. If 1 player has 3 what does the other player have? Also you have done an assignment operator instead of the strict equality operator.

You haven’t used the textContent or innerText to update your HTML messages.

YOu haven’t used the style.display methods - see the tips. I suggest you follow this to understand how to do it.