控制台报错
代码
window.onload = function(){
var para = document.createElement("p");
var testdiv = document.getElementById("testdiv");
testdiv.appendChild(para);
var txt = document.createTextNode("Hello world");
para.appendChild(txt);
}
Uncaught TypeError: Cannot read property 'appendChild' of null
at window.onload (test.js:4)
window.onload @ test.js:4
繁星淼淼
相关分类