87,902
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script language="JavaScript" type="text/JavaScript">
function addbut(){
var container=document.getElementById("div1");
var frag = document.createDocumentFragment();
for (var i=0;i<10;i++)
{
var btn = document.createElement("input");
btn.type="button";
btn.value="nuw Button"
frag.appendChild(btn);
}
container.appendChild("frag");
}
</script>
</head>
<body onload="addbut()">
<div id="div1"> hello</div>
</body>
</html>
然后chrom调试 DOM exception 8了~~~~~~什么情况? 刚学JS。。。。这类问题怎么解决~?谢谢您啦!