Review Algorithmic Thinking by Building a Dice Game - Step 4

Tell us what’s happening:

My code works but The challenge is still saying i must display a browser alert. What am I doing wrong?

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("Please select a score");
  }
});

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 4

I updated my code to be rollDiceBtn.addEventListener(“click”, () => {
rollDice();
if (rolls >= 3) {
alert(“Please select a score”);
} else {
rolls++;
}
});
but I am still not passing

I figured it out. the rollDice function was still running after I clicked rolls > 3