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

Tell us what’s happening:

it kept me saying
Your resetGame function should set the playerScore to 0.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

function resetGame() {
  playerScore = 0;
  computerScore = 0;
  playerScoreSpanElement.innerText = playerScore;
  computerScoreSpanElement.innerText = computerScore;
  resetGameBtn.style.display = "hidden";
  optionsContainer.style.display = "block";
  roundResultsMsg = "";
  winnerMsgElement = "";
};

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

Welcome to the forum @YashJunagade

Check the syntax for these two lines.

Happy coding.

2 Likes

I was stuck here too with the same error… good time to learn about . innerText and .innerHTML. The error is confusing because it makes you wonder there’s something wrong with the variable, but it’s got to do with the last two lines itself. It becomes even clearer when you play the game and might spot something unusual when you reset it. All the best :slight_smile:

2 Likes

yess thank you…i solved that later it just a syntax error

1 Like

Thank you so much :call_me_hand: :pray:

2 Likes

Oh that was the problem. I kept changing the playerScore and computerScore variables, not knowing I did not add .innerText to the roundResultsMsg and winnerMsgElement. I’ve been stuck on this project for 2 days
Thanks :+1:

It’s not :

removed

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

1 Like