Question:
Why do I get the error message of Cannot parse given error object when I try to run this Javascript code in replit?
Current behavior:
Desired behavior
Repl link:
let xp=0;
let health=100;
let gold=50;
let currentWeapon=0;
let fightening;
let monsterHealth;
let inventory=["stick"];
const button1.querySelector("#button1");
const button2.querySelector("#button2");
const button3.querySelector("#button3");
const text=document.querySelector("#text");
const xpText=document.querySelector("#xpText");
const goldText=document.querySelector("goldText");
const monsterStats=document.querySelector("#monsterStats");
const monsterNameText=document.querySelector("#monsterName");
const monsterHealthText=document.querySelector("#monsterHealth");
button1.onclick=goStore;
button2.onclick=goCave;
button3.onclick=fightDragon;
function goStore() {
console.log("Going to store.")
}
function goCave() {
console.log("Going to cave.")
}
function fightDragon() {
console.log("fightening Dragon")
}