Cannot read properties of null (reading 'innerHTML')
时间: 2023-10-12 22:08:06 浏览: 187
Cannot read properties of null (reading 'innerHTML')这个错误通常发生在尝试访问一个值为null的属性时。根据引用中的描述,这种错误一般是由于没有获取到该元素所导致的。引用的例子中提到了一个HTML元素的ID名为files-list,但是代码中没有找到这个元素。因此,在尝试访问该元素的innerHTML属性时会报错。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Uncaught TypeError: Cannot set properties of null (setting ‘innerHTML‘)报错的一种](https://blog.csdn.net/m0_49442965/article/details/128740836)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [HTML页面报错“Cannot read property 'innerHTML' of null](https://blog.csdn.net/cnds123321/article/details/102508599)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文