var ck=document.createElement("input");
ck.type="checkbox";
ck.id="ck"+i;
document.getElementById('divFileContainer').appendChild(ck);
document.getElementById("ck"+i).checked=true;
ck.type="checkbox";
ck.id="ck"+i;
document.getElementById('divFileContainer').appendChild(ck);
document.getElementById("ck"+i).checked=true;
这样应该可以
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<div id="div1"></div>
<script type="text/javascript">
window.onload=function(){
var oChk=document.createElement("input");
oChk.type="checkbox";
//oChk.checked=true;在ie下不行在firefox下没问题
document.getElementById("div1").appendChild(oChk);
oChk.checked=true;//放到这都可以
}
</script>
</body>
</html>