日期:2014-05-17 浏览次数:20460 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>test</title>
<script>
function CheckAll(value,obj) {
var form=document.getElementsByTagName("form")
for(var i=0;i<form.length;i++){
for (var j=0;j<form[i].elements.length;j++){
if(form[i].elements[j].type=="checkbox"){
var e = form[i].elements[j];
if (value=="selectAll"){e.checked=obj.checked}
else{e.checked=!e.checked;}
}
}
}
}
</script>
</head>
<body>
<form name="c" method="post" action="<#ZC_BLOG_HOST#>?cat=2">
<input name="id" type="checkbox" id="id" value="1">
<input name="id" type="checkbox" id="id" value="2">
<input name="id" type="checkbox" id="id" value="3">
<input name="id" type="checkbox" id="id" value="4">
</form>
<form name="<#ZC_BLOG_HOST#>?cat=11" method="post" action="">
<input name="id" type="checkbox" id="id" value="5">
<input name="id" type="checkbox" id="id" value="6">
<input name="id" type="checkbox" id="id" value="7">
<input name="id" type="checkbox" id="id" value="8">
</form>
<INPUT onclick=CheckAll('selectAll',this) type=checkbox value=on name=chkall>
全选
<input type="checkbox" name="invest" value="checkbox" onClick="CheckAll()">
反选
</body>
</html>