Tell us what’s happening:
My code is performing the tasks that fCC is asking, however it won’t accept my answer.
I’ve also noticed an issue where the ‘Roll the dice’ button may be clicked three times before an alert appears, however when I click to close the alert, the dice roll function occurs for a forth time. How can I stop it from generating another set of numbers when dismissing the alert?
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
rollDiceBtn.addEventListener("click", () => {
rollDice();
if (rolls === 3) {
alert("You have made three roles this round. Please select a score.");
} else {
rolls++;
rollDice();
}
});
// 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
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 4