Tell us what’s happening:
I don’t understand what the issue is. My current code does not have the winnerMsgElement updated but when I do, the console will tell me that there is a typerror or that it is not defined.
In addition, it seems that whenever I try to update the winnerMsgElement, my other code becomes nullified and I regress in steps. – going from 2/3 steps completed to 0/3.
Can someone explain what the issue is?
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 || computerScore === 3)
{optionsContainer.style.display = "none";
resetGameBtn.style.display = "block"}
};
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) 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