Tell us what’s happening:
what am I missing? even i call the update score function
the error message is: When your keepScoreBtn is clicked, the score should be updated in the totalScore tex
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
keepScoreBtn.addEventListener("click", () => {
let selectedValue
let achived
//iterating over a collection of radio buttons and checking which one is currently selected.
for (const radioButton of scoreInputs) {
if (radioButton.checked) {
selectedValue = radioButton.value // pass radioButton value to selectedValue variable
achived = radioButton.id // pass radioButton id to achived variable
break; // avoid unecessary radiobutton
}
// If the user has selected an option call your functions to UPDATE the SCORE, RESET the RADIO OPTION, and add the VALUE and ID to the SCORE HISTORY.
if (selectedValue) { // truthy value
rolls = 0
round++
updateStats() // call the func where to update current soll & round
resetRadioOptions() // reset radio
updateScore(selectedValue, achived); // call the func to update score with value & is and the text of the history
} else {
alert("Pleas select an option or roll the dice")
}
}
});
// 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 10