0
JavaScript returns an error when using innerHTML
Here is the code link, https://code.sololearn.com/WLAIVQWs20NM/?ref=app
2 Antworten
+ 2
On sololearn, the page has to load before accessing it with JavaScript. So instead of:
var elem = document.getElementById("test");
Do:
var elem;
window.onload = function() {
elem = document.getElementById("test");
}
0
Thanks, it works very okkkey