0
I tried any JS code - TypeError, another one - again Error!
https://cdn.discordapp.com/attachments/1101905487076802701/1124387929104584784/Screenshot_727.png https://cdn.discordapp.com/attachments/1101905487076802701/1124387929356238908/Screenshot_726.png https://cdn.discordapp.com/attachments/1101905487076802701/1124387929612111942/Screenshot_725.png for code: https://www.sololearn.com/compiler-playground/WdTGP4Lp8DV1
4 odpowiedzi
+ 4
You can only get the element by id once the DOM is fully loaded.
Put the part inside of the onload function.
+ 2
山 Zed Please send the code not images of it.
+ 2
As already mentioned:
Put
let btn = document.getElementById("favorite-button-littleone-berryassort")
inside the onload function.
+ 1
Junior, here it is.
https://www.sololearn.com/compiler-playground/WdTGP4Lp8DV1