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

Tell us what’s happening:

Hello i keep getting an error on my code that says you need to update your winnerMsgElement if there is a winner but i think i did that , i cannot locate an error, please help.

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.innerText = "Player has won the game!";
     resetGameBtn.style.display = block;
     optionsContainer.style.display = none;
   } else if (computerScore === 3) {
     winnerMsgElement.innerText = "Computer has won the game!";
     resetGameBtn.style.display = block;
     optionsContainer.style.display = none;
   }
};

// 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/126.0.0.0 Safari/537.36

Challenge Information:

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

check the console and you will see

[ReferenceError: block is not defined]

can you figure out where it is coming from and how to fix it?

1 Like

You are missing " " for the style.display . otherwise it should pass.

Thank you so much i figured it out i didnt put display properties into quotations the error wasnt reffering to that part of a code thats what confused me

1 Like

all tests fail if you have a syntax error, so be mindful to check for those

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.