Tell us what’s happening:
Not sure what the problem is here.
I can roll the dice 3 times and then an alert shows as instructed and the rolls counter resets to zero.
Is that not what it asks for?
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
rollDiceBtn.addEventListener("click", () => {
rollDice();
rolls ++;
if (rolls > 3){alert("Maximum Rolls Reached - Select a Score"); rolls = 0}
});
// 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/126.0.0.0 Safari/537.36 Edg/126.0.0.0
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 4