+ 2
Help with dom model
https://code.sololearn.com/Wg85IOl4FL7W/?ref=app Console is showing null value. Can anyone tell me what I am doing wrong and how to get "game test" to show in the console?
3 ответов
+ 2
Copy this to your JS file. And follow me pls👌
window.onload = function() {
var game = document.getElementById("test");
game.innerHTML = "game test";
console.log(game.innerHTML);
}
+ 1
the js run before the page are loaded. here is the fix
https://code.sololearn.com/WMjglSL3lMeq/?ref=app
+ 1
Good day foofghtr7!
Others have pointed out the issue and I believe you would be interested with this. 😉
https://code.sololearn.com/WXe61FrE4YD4