https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/#learn-basic-javascript-by-building-a-role-playing-game 46
Now you need to modify your display text. Change the innerText
property of the text
to be You enter the store.
.
function goStore() {
button1.innerText = “Buy 10 health (10 gold)”;
button2.innerText = “Buy weapon (30 gold)”;
button3.innerText = “Go to town square”;
button1.onclick = buyHealth;
button2.onclick = buyWeapon;
button3.onclick = goTown;
}
NEED HELP! GOT STUCK HERE
Hi @ikeabhus ,
It’s asking you to add an innerText property with You enter the store.
The wording confused me as well the first time around.
2 Likes
The text
variable referred to is this element (at the top of the code).
const text = document.querySelector("#text");
Inside the goStore
function add the text
variable and on it use the .innerText
property. Then assign it =
the string "You enter the store."
someElement.innerText = "Some string"
2 Likes
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.