为什么这段代码不会显示你好世界?它说 text.content 为 null

时间:2021-05-01 11:28:23

标签: javascript

我通过使用脚本将此代码链接到 html 但显示此代码来编写此代码

<块引用>

未捕获的错误:text.content of null。

const myHeading = document.querySelector('h1');
myHeading.textContent = 'Hello world!';

0 个答案:

没有答案
相关问题