hey there!
I have followed all the instructions given and even tested my code by playing the game and it works fine.
However on clicking “Check Your Code” the console displays “You should add an event listener to the resetGameBtn button. The event listener should take in a “click” event and a reference to the resetGame function.” but I have done this!
What mistake have I made in the code. Please help! Thank you
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
function resetGame () {
playerScore = 0;
computerScore = 0;
roundResultsMsg.innerText = "";
roundResultsMsg.innerText = "";
roundResultsMsg.innerText = "";
computerScoreSpanElement.innerText = 0;
playerScoreSpanElement.innerText = 0;
resetGameBtn.style.display = "none";
optionsContainer.style.display = "";
}
// 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/147.0.0.0 Safari/537.36
I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with three backticks to make it easier to read and test.
You can also use the “preformatted text” tool in the editor (</>) to add the backticks.