Tell us what’s happening:
I can’t seem to figure out why I can’t pass step 4, I’ve checked that my score variables are working in console.log, and I double checked the innerText syntax.
The instructions:
Step 4
Now it is time to update the scores and the round results message.
Complete the
showResults
function. TheplayerScoreSpanElement
andcomputerScoreSpanElement
should be updated to show the updated scores of the player and computer.The
roundResultsMsg
should also be updated with the result of the round.Tips
- Remember that you learned how to work with the
innerText
property to update the text content of an element.- You can use the
getRoundResults
function to get 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) {
playerScoreSpanElement.innerText = playerScore;
computerScoreSpanElement.innerText = computerScore;
roundResultsMsg.innerText = getRoundResults(userOption);
};
showResults("Scissors");
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0
Challenge Information:
Review DOM Manipulation by Building a Rock, Paper, Scissors Game - Step 4