+ 6
Why this doesn't work???
Its a clicker game, I wanted to add another upgrade but it gives an error, i dont know how to fix it. There are the two codes, the first is the one that gives an error and the second is the good one. (I want to add a better auto clicker, that its cost is 500 and every upgrade, the intervals in each mega auto click divides by 4.) https://code.sololearn.com/WVL3YWQBPK50/?ref=app https://code.sololearn.com/WbYkU1Mdq56Q/?ref=app
10 odpowiedzi
+ 6
in line 77 you have
document.getElementById('mega-Auto-Clicker-Cost').innerText
The id of the element is
'mega-auto-clicker-Cost'. Compare – Javascript is case sensitive.
+ 3
Great that you could fix it! 👍👍
+ 2
At which line in the script do you define what "MegaAutoClickerButton"? Did you spell the name correctly?
+ 2
Javascript is case-sensitive, the spellings need to match exactly:
const MegaAutoClickerButton = document.getElementById("Mega-auto-clicker");
+ 2
Okay, I corrected it.
+ 2
Check again how you spelt the id in the html part and how you spelt it in line 77
+ 1
Ummm I think its written correctly
+ 1
But now it gives another error, reading "inner text" at line 77
+ 1
I dont find the error
+ 1
Okay its done, the type error was that in one line, I put "meegaautoclicker" thats why it wasnt working.