Tell us what’s happening:
The question is to make a method that takes two parameters, an int and a string. The number will increase the total, the total is shown in a span element. Then a list item is created and added to an ordered list that shows the string param and the num param. I have this working locally, I’ve tried all sorts of textContent, innerText, innerHTML, parseInt() approaches to pass this section. What am I missing?
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const updateScore = (selectedValue, achieved) => {
total += selectedValue;
totalScore.textContent = total;
let scoreLabel = document.createElement("li");
scoreLabel.textContent = `${achieved} : ${selectedValue}`;
scoreHistory.appendChild(scoreLabel);
}
// updateScore(10, "hi");
// 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 9