Tell us what’s happening:
It says “when your keepScoreBtn is clicked the score history should be updated”, I already called the updateScore function I have no idea where is my mistake
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
keepScoreBtn.addEventListener("click", () => {
const selectedRadio = document.querySelector('input[name="score-options"]:checked');
if(!selectedRadio){
alert("Please select a score option!");
return;
}
const selectedRadioValue = selectedRadio.value;
totalScoreElement.textContent = selectedRadioValue;
const achieved = selectedRadioValue.id;
updateScore(selectedRadioValue, achieved);
resetRadioOptions();
})
// User Editable Region
/* file: styles.css */
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 Edg/134.0.0.0
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 10