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

Tell us what’s happening:

function resetGame() {
playerScore = 0
computerScore = 0
playerScoreSpanElement = playerScore
computerScoreSpanElement = computerScore
resetGameBtn.style.display = “hidden”
optionsContainer.styles.display = “block”
winnerMsgElement = “”
roundResultMsg = “”
};

in what world does this not work ive been at this for at least half an hour by now XDDDDDDDDDDDDDDDDDDDDDDDDDDd im going insane

Your code so far

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

/* file: styles.css */

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

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

// 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/124.0.0.0 Safari/537.36

Challenge Information:

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

sorry i might have asked a bit rudely, my head is hurting by now, im pretty sure this should be correct, the game itself is working as it should so im really confused :slight_smile:

1 Like

Hi @humanmusics !

Welcome to the forum!

When I copy and paste your code, I see this error message

[TypeError: “playerScoreSpanElement” is read-only]

that is pointing to here

Remember you learned how to update text using a special property.
if you need extra help, look to a previous project you did earlier.
For example, look to this RPG function you created earlier.

function goTown() {
  button1.innerText = "Go to store";
  button2.innerText = "Go to cave";
  button3.innerText = "Fight dragon";
  button1.onclick = goStore;
  button2.onclick = goCave;
  button3.onclick = fightDragon;
  text.innerText = "You are in the town square. You see a sign that says \"Store\".";
}

once you fix that, then you should see this error message

[TypeError: “computerScoreSpanElement” is read-only]

it points to the same issue

Once I fix that, then I get a different type error

[TypeError: Cannot set properties of undefined (setting ‘display’)]

the issue is here
you have a typo in the first part

once you fix that, then you have this issue

[TypeError: “winnerMsgElement” is read-only]

it is the same issue as the first two issues I mentioned

then here is the last issue

[ReferenceError: roundResultMsg is not defined]

you have typo here

then you should see this error message here

[TypeError: “roundResultsMsg” is read-only]

it is the same issue you had with the first two issues I mentioned.

Once I fix all of that, then it passes.

So you were close, but you just missed a couple of things and created a few typos

hope that helps

1 Like

oh my god i see now, that helped a lot, thank you very much for your help and sorry for the initial mental breakdown over this :smiley:

2 Likes

no worries.
happy to help.

learning to program is hard.
but working through issues and struggling at times is actually the best thing to happen to any programmer.
because that is the only way to grow.
You learn so much through trial and error.

And now, you have learned how to better debug your code like I did.
And you learned how to work through error messages better because of this experience :+1:

it is all part of the learning and growing process :+1:

1 Like

solution removed by moderator

hey @javi.javier.jc

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

I removed your code since it was a working solution.
But as mentioned earlier, if you had a question, then please open up your own topic.
Thanks

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.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.