Tell us what’s happening:
Something weird is happening. The following code works and passes:
rollDiceBtn.addEventListener(“click”, () => {
rollDice();
rolls++;
if(rolls === 3){
alert(“You already rolled 3 times. You must select a score now.”);
rollDiceBtn.disabled = true;
}
});
But if I remove the part " rollDiceBtn.disabled = true;" the check fails. But this was only added by me as an additional idea and should not affect the check itself.
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("You already rolled 3 times. You must select a score now.");
}
});
// 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/134.0.0.0 Safari/537.36
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 4