0

[SOLVED] text content is not setting value

Hey guys i get a problem whenever i am using getElementById in sololearn its always shows me an error <p id="demo"></p> document.getElementById("demo").textContent = "Hello world"; and its shows me error

17th Apr 2020, 5:56 PM
Abdul Azeez
Abdul Azeez - avatar
1 Answer
+ 2
Wrap the code in your JS in window.onload = function () { code here }
17th Apr 2020, 7:08 PM
ChaoticDawg
ChaoticDawg - avatar