var body =document.body; var newdiv = document.createElement("p"); var newdivword = document.createTextNode("iloveyou"); newdiv.setAttribute("class","message"); body.appendChild(newdiv); newdiv.appendChild(newdivword);
5 回答
呼啦啦9527
TA贡献3条经验 获得超11个赞
window.onload = function(){
var body =document.body;
var newdiv = document.createElement("p");
var newdivword = document.createTextNode("iloveyou");
newdiv.setAttribute("class","message");
body.appendChild(newdiv);
newdiv.appendChild(newdivword);
}
添加回答
举报
0/150
提交
取消