Tell us what’s happening:
i tried all possible solution what can’t solve this problem
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");
function showResults(roundResultsMsg) {
// Get the result of the round
const result = getRoundResults(userOption);
// Update the scores (assuming these functions are available)
const playerScore = getPlayerScore();
const computerScore = getComputerScore();
// Update the score elements
playerScoreSpanElement.innerText = `Player Score: ${playerScore}`;
computerScoreSpanElement.innerText = `Computer Score: ${computerScore}`;
// Update the round results message
if (result === "win") {
roundResultsMsg.innerText = `You chose ${userOption}, and you win!`;
} else if (result === "lose") {
roundResultsMsg.innerText = `You chose ${userOption}, and you lose!`;
} else {
roundResultsMsg.innerText = `You chose ${userOption}, and it's a tie!`;
}
};
showResults(roundResultsMsg);
// 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 4