标签: javascript null innertext
我正在尝试使用js编辑其中的文本。尝试运行该错误消息时出现此错误消息:未捕获的TypeError:无法将属性'innerText'设置为null。
HTML:
<body> <h1 id='title'></h1>
JS:
document.getElementById('title').innerText = "test";