Cannot read property ‘innerHTML’ of null
出现这个错误可能的原因:
1、下面代码中,如果我的 this 没有获取到值,就会报这个错;
$(this).parents("tr").children[3].innerHTML;
2、没有获取到当前 id 的值
(下面代码中,如果 id 输入错误,也会报这个错)
toPrice = document.getElementById("goods_Price").innerHTML;
3、数据没有加载完就进行获取,获取不到该值。
参考这篇博客:https://blog.youkuaiyun.com/mini_1251861209/article/details/81867575