我现在学的是插入子节点:
function addyellow()
{
var YellowObj=document.createElement("div");
YellowObj.style.width='40px';
YellowObj.style.height='40px';
YellowObj.style.backgroundColor='yellow';
YellowObj.style.float= "left";
YellowObj.style.height='40px';
one.appendChild(YellowObj);
}
我想问问,除了这样还有办法吗?我就是了解一下,扩充一下知识,也没真的要插入
innerHTML
或者replaceChild