function goCave() {
console.log(“Going to cave”);
}
function fightDragon() {
// console.log(“Fighting dragon.”);
button3.onclick = “goTown”;
}"
and what the instruction says " You will also need to update the functions that run when the buttons are clicked again.
In your goStore() function, update the onclick property for each button to run buyHealth, buyWeapon, and goTown, respectively. "
Hello:)
You should keep the already written code as it is. You have to keep the goStore function as it is:
function goStore() {
button1.innerText = "Buy 10 health (10 gold)";
button2.innerText = "Buy weapon (30 gold)";
button3.innerText = "Go to town square";
}
And then you have to add within the function,
as the step says: “update the onclick property for each button to run buyHealth , buyWeapon , and goTown , respectively.”
If you click on gostore button, it is going to update all three buttons inner text already. With updating the onclick to : buyHealth , buyWeapon , and goTown , you will add in the future some functions and then sth going to happen:)