Review Algorithmic Thinking by Building a Dice Game - Step 10

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

  1. The updateScore function is responsible for updating both the score and history elements. Do not update the elements outside it.

  2. You are not getting the id correctly. It is on the element, not the value.

Thank you so much, I was able to see my mistake appreciate it

1 Like