用下拉框数值定复选框的个数,老是有问题
<script language="javascript">function sc(){
var G=document.getElementById("box").value;
for (A=1;A<G;A++);
document.getElementById("div2").innerHTML=document.getElementById("div2").innerHTML+"<input type='checkbox' name='X("+A+")'>"+A+" ";
}
</script>
<select name="box" onChange="sc(this.value)">
<option>-请选择-</option>
<option value="2">-二-</option>
<option value="4">-四-</option>
<option value="8">-八-</option>
<option value="12">-十二-</option>
</select>
<br><br>
<br>
<br>
<br>
<br>
<div id="div2">
</div>