Uncaught Typeerror: cannot read property 'innerHTML' of null

前端 未结 8 2243
遥遥无期
遥遥无期 2020-12-05 12:04

Can anyone explain what is theses errors?

Uncaught TypeError: cannot read property \'innerHTML\' of null

View on my website This

8条回答
  •  猫巷女王i
    2020-12-05 12:55

    I had a similar problem, but I had the existing id, and as egiray said, I was calling DOM before it loaded and Javascript console was showing the same error, so I tried:

    window.onload = (function(){myfuncname()});
    

    and it starts working.

提交回复
热议问题