Tell us what’s happening:
Describe your issue in detail here.
These are the instructions… Now you need to modify your display text. Change the innerText
property of the text
to be You enter the store.
I have been trying to get the solution to pass. Help pls
/* file: script.js */
let xp = 0;
let health = 100;
let gold = 50;
let currentWeapon = 0;
let fighting;
let monsterHealth;
let inventory = ["stick"];
const button1 = document.querySelector('#button1');
const button2 = document.querySelector("#button2");
const button3 = document.querySelector("#button3");
const text = document.querySelector("#text");
const xpText = document.querySelector("#xpText");
const healthText = document.querySelector("#healthText");
const goldText = document.querySelector("#goldText");
const monsterStats = document.querySelector("#monsterStats");
const monsterName = document.querySelector("#monsterName");
const monsterHealthText =document.querySelector("#monsterHealth");
// initialize buttons
button1.onclick = goStore;
button2.onclick = goCave;
button3.onclick = fightDragon;
/* User Editable Region */
function goStore() {
button1.innerText = "You enter the store.";
button2.innerText = "You enter the store.";
button3.innerText = "You enter the store.";
button1.onclick = buyHealth;
button2.onclick = buyWeapon;
button3.onclick = goTown;
}
/* User Editable Region */
function goCave() {
console.log("Going to cave.");
}
function fightDragon() {
console.log("Fighting dragon.");
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 46