Tell us what’s happening:
The console gives me error even though my code is working as intended.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
keepScoreBtn.addEventListener('click', () => {
const selectedInput = document.querySelector('#score-options input:checked');
if (selectedInput) {
const achievementLabel = selectedInput.parentElement.textContent.split(',')[0].trim();
updateScore(selectedInput.value, achievementLabel);
rolls = 0;
round++;
resetRadioOptions();
updateStats();
} else {
alert('Please select a scoring option');
}
});
// 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/131.0.0.0 Safari/537.36 Edg/131.0.0.0
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 10