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

Tell us what’s happening:

Can I please get assistance here, I have been trying for an hour.

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(userOption) {
     
      playerScoreSpanElement.innerText = playerScore;
      computerScoreSpanElement.innerText = computerScore;
       roundResultsMsg = getRoundResults(userOption);
    }
     
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/133.0.0.0 Safari/537.36

Challenge Information:

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

Hi. You need to get the updated scores by calling the relevant function inside the function

You haven’t updated the roundResultsMsg html using the correct method.

an other issue: getRoundResults update playerScore and computerScore, but you are writing the old values to the html, as you are first writing the values then calling getRoundResults

I’m not sure what is the correct method in this case

should I update them to userOption and computerResult?

Look at the property used on the variables playerScoreSpanElement and computerScoreSpanElement in your function. What is missing if you want to update the HTML on your screen with your Round Results? The instructions say to update your round results message with the results of the round. That means the screen that the user sees should be displayed with the round results. (A property is applied to an element. The element here is represented by the variable in your function).

The first part of my previous message also states that you also need to call the roundResults function within your function. @ILM explains further why. Think also about the order your code is executed in, think where to put the function call.