天天看点

【异常】Cannot read property ‘innerHTML‘ of null

Cannot read property ‘innerHTML’ of null

出现这个错误可能的原因:

1、下面代码中,如果我的 this 没有获取到值,就会报这个错;

2、没有获取到当前 id 的值

(下面代码中,如果 id 输入错误,也会报这个错)

3、数据没有加载完就进行获取,获取不到该值。

参考这篇博客:https://blog.csdn.net/mini_1251861209/article/details/81867575

继续阅读