2008-11-08 17:01:22 / JavaScript & VBScript & DHTML 脚本技术讨论版
#box,#box1 {width:200px; height:300px; background-color:#ff0000;margin-top:5px;}#cent {width:200px; height:34px;background-color:#cccccc;}function $(str) { return (document.getElementById(str));}var divBox = document.createElement("div");divBox.setAttribute("id","box");var cent = document.createElement("div");cent.setAttribute("id","cent");document.body.appendChild(divBox);divBox.appendChild(cent);$("box1").appendChild(cent);//这里为什么不可以?
查看(221)
评论(5)