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

Tell us what’s happening:

not sure whAT is wrong i keep getting the error Your showResults function should update the roundResultsMsg with the result of the round.

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.querrySelector(".options-container");
const resetGameBtn = document.getElementById(rest-game-btn);

function showResults(userOption) {roundRsultsMsg.innerText = getRoundResult (userOption);
computerScoreSpanElement.innerText = computerScore;
playerScoreSpanElement.innerText = playerScore;



};

const rockBtn = document.getElementById("rock-btn");
const paperbtn = document.getElementById("paper-btn");
const scissorsBtn = document.getElementById("scissors-btn");

rockBtn.addEventListener("click", function () {
showResults("Rock");
});

// 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

Challenge Information:

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

Tell us what’s happening:

not sure whats wrong i cant get this to pass i keep getting the hint Your showResults function should update the roundResultsMsg with the result of the round.

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.querrySelector(".options-container");
const resetGameBtn = document.getElementById(rest-game-btn);

function showResults(userOption) {roundRsultsMsg.innerText = getRoundResults (userOption);
computerScoreSpanElement.innerText = computerScore;
playerScoreSpanElement.innerText = playerScore;



};

const rockBtn = document.getElementById("rock-btn");
const paperbtn = document.getElementById("paper-btn");
const scissorsBtn = document.getElementById("scissors-btn");

rockBtn.addEventListener("click", function () {
showResults("Rock");
});

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

Challenge Information:

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

You have modified the code outside of function showResuts

Reset the challenge step and carefully read the instructions and try again.

Within the function you also need to update roundResultsMsg innerText by assigninggetRoundResluts () function with userOption parameter.

If you take a look at the console, there’s couple errors displayed when running tests.

Hi there!

Is that the correct syntax to call a function.?

I have merged your two topics, please open a single topic per step

i must not understand code very well because these are the errors i keep getting and i have no idea why our

showResults

function should update the

roundResultsMsg

with the result of the round. 2. Your

showResults

function should update the

computerScoreSpanElement

to show the updated score of the computer. 3. Your

showResults

function should update the

playerScoreSpanElement

to show the updated score of the player.
add as far as i know it does

These are tests outputs. Errors are below that:

Uncaught TypeError: document.querrySelector is not a function
[ReferenceError: roundRsultsMsg is not defined]

isnt that all taken care of on line 34