0
Help me Out with .innerHTML
3 Answers
0
Your js code is a mess ,I cudn't even care to read it !however put your js code in this function:
window.onload=function(){
Js code goes here
}
It will stop the JavaScript running before html is loaded ,if JavaScript runs before html it will return null as there is no element with id container ,
0
The problem is that the javascript part is being called before the html part has been loaded. So the id container does not exist yet when document.getElememtById("container") is called.
So what you can just do is, put all the code inside a window.onload function. The format would be
window.onload = function() {
// the full code here
}
0
Thanks a lot