各位大俠幫幫忙 //js代碼 <script type="text/javascript"> function checks(){ var cn=document.getElementById("check1"); var cn2=document.getElementById("check2").childNodes;
if(cn.checked==true) { for(var i=0;i<cn2.length;i++) { var a=cn2[i];
<script type="text/javascript">
function checks(){
var cn=document.getElementById("check1");
var cn2=document.getElementById("check2").childNodes;
for(var i=0;i<cn2.length;i++)
{
var a=cn2[i];
[color=#FF0000]a.checked = cn.chkecked[/color]
}
}
</script>
------解决方案--------------------
JScript code
function checks() {
var cn = document.getElementById("check1");
var cn2 = document.getElementById("check2").childNodes;
if (cn.checked) {
for (var i = 0; i < cn2.length; i++) {
if (cn2[i].type == "checkbox") {
cn2[i].checked = true;
}
}
}
}
------解决方案--------------------