0
What is wrong with this code?
let demo = document.getElementById("p-el").innerHTML console.log(demo) I'm getting a "cannot read property null of InnerHTML
3 Answers
+ 1
Put the code right after the html code in the body tag with the script tag, the js code is being run before the html gets loaded.
0
Thanks it worked.. But is this peculiar to SoloLearn ide how that's how it generally is?
0
Well I don't know about that, I've never really done a js project outside of sololearn but I've definitely seen a lot of complaints on that outside of sololearn so maybe.