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

Tell us what’s happening:

playerScore and computerScore doesn’t get updated. I tried computerScoreSpanElement.innerText = +1, computerScoreSpanElement.innerText = 1, playerScoreSpanElement.innerText = +1, playerScoreSpanElement = 1.
And if isn’t working because I simply don’t know what to put as a condition.

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) {
roundResultsMsg.innerText = 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/125.0.0.0 Safari/537.36

Challenge Information:

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

remember that your variables playerScore and computerScore already get updated when you call the function getRoundResults. assign the value of your updated variables to the span elements innerText.

when you do this:

computerScoreSpanElement.innerText = +1
computerScoreSpanElement.innerText = 1
playerScoreSpanElement.innerText = +1
playerScoreSpanElement.innerText = 1.

you are just assigning them a value of 1

1 Like