Tell us what’s happening:
When your keepScoreBtn is clicked, the score should be updated in the totalScore text.
When your keepScoreBtn is clicked, the radio options should be reset.
When your keepScoreBtn is clicked, the score history should be updated.
I have these errors when I try to run my code, although I don’t know why.
I used the updateScore function to update the totalScore element and the scoreHistory, and I used resetRadioOptions, but it still tells me that I haven’t.
I would appreciate any help. Thanks!
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
keepScoreBtn.addEventListener("click", () => {
const selectedOption = document.querySelector('input[name="score"]:checked');
if(selectedOption) {
updateScore(selectedOption.value, selectedOption.id);
resetRadioOptions();
} else {
alert("alert")
}
});
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) 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 10