Tell us what’s happening:
I am about to freak out. I’ve searched for the same problem on the forum and I’ve tried some solutions but my code it still not working. Please help.
Your code so far
<!-- file: index.html -->
/* 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);
playerScoreSpanElement.innerText = playerScore;
computerScoreSpanElement.innerText = computerScore;
if(playerScore === 3 && computerScore < 3){
winnerMsgElement.textContent = "Player has won the game!";
optionsContainer.style.diplay = "block";
resetButton.style.displa = "none";
}else if(computerScore === 3 && playerScore < 3){
winnerMsgElement.textContent = "Computer has won the game!";
optionsContainer.style.diplay = "none";
resetButton.style.display = "block";
}
};
// User Editable Region
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Challenge Information:
Review DOM Manipulation by Building a Rock, Paper, Scissors Game - Step 5