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

Tell us what’s happening:

My cod gives me the same error: 'You should update the winnerMsg Element if there’s a winner, but i already have

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){
    winnerMsgElement.innerText = 'Player has won the game!';
    resetGameBtn.style.display = 'block';
    optionsContainer.stlye.display = 'none';
  } else if(computerScore === 3 && playerScore < 3){
    winnerMsgElement.innerText = 'Computer has won the game!';
    resetGameBtn.style.display = 'block';       
    optionsContainer.stlye.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/131.0.0.0 Safari/537.36 Edg/131.0.0.0

Challenge Information:

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

Welcome to the forum @TinyMadder

You have a few typos.

Happy coding

Kesalahan terjadi karena ada salah ejaan pada optionsContainer.stlye.display. Harusnya style, bukan stlye.

I have this exact same issue, my code is the same, even the spelling error with style is the same. Did you find the solution?

In the future, please create your own topic when you have specific questions about your own challenge code. Only respond to another thread when you want to provide help to the original poster of the other thread or have follow up questions concerning other replies given to the original poster.

The easiest way to create a topic for help with your own solution is to click the Ask for Help button located on each challenge. This will automatically import your code in a readable format and pull in the challenge url while still allowing you to ask any question about the challenge or your code.

Thank you.