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

Tell us what’s happening:

I still get the Error “showResults should update 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");

function showResults(userOption) {
  const computerResult = getRandomComputerResult();
  if (hasPlayerWonTheRound(userOption, computerResult) == true) {
    playerScore++;
    roundResultsMsg.innerText = getRoundResults(userOption);
    playerScoreSpanElement.innerText = plaerScore;
  }
  else if (hasPlayerWonTheRound(userOption, computerResult) == false) {
    computerScore++;
    roundResultsMsg.innerText = getRoundResults(userOption);
    computerScoreSpanElement.innerText = computerScore;
  }
  else {
    roundResultsMsg.innerText = getRoundResults(userOption);
  }

  computerScoreSpanElement.innerText = computerScore;
  playScoreSpanElement.innerText = playerScore;
  roundResultsMsg.innerText = getRoundResults(userOption);

};

showResults("Rock");

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15

Challenge Information:

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

Hi. You only need the last 3 lines of your code inside the function if you look at the instructions.

There is a typo on your second line with the variable name.
You need to call the function for getRoundResults(userOption) first as well so cut and paste that to the first line (as well as leaving it as the value for your innerText).