I do not seem to understand the correct value that I am update the element to
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
function updateStats(rolls, round) {
const currentRound = document.getElementById("current-round");
const currentRoundRolls = document.getElementById("current-round-rolls");
}
rollDiceBtn.addEventListener("click", () => {
if (rolls === 3) {
alert("You have made three rolls this round. Please select a score.");
} else {
rolls++;
rollDice();
updateStats();
}
});
// 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 5
Hello,
first, you do not have to pass the rolls and round variables to your function updateStats, they are defined outside of it at the top of the script.
You also do not have to reselect the currentRound and currentRoundRolls variables as you already did that at the top of the script.
To change the text of a selected element, you can use the textContent property, here is an example, I have a div element, I am going to select it and then add the text Hello World to it
const target = document.querySelector("div");
const myText = "Hello World"; // this is the text I want to add to my div
target.textContent = myText;
```