<html>
<head>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script>
/**jquery实现全选 反选**/
function allCheck(){
if($('#allorNo').attr('checked')!='checked'){
$("input[name='checkAll']").removeAttr('checked');
}else{
$("input[name='checkAll']").attr('checked','true');
}
}
</script>
</head>
<body>
<tr>
<th><input id="allorNo" type="checkbox" οnclick="allCheck();"></th><br>
<th><input type="checkbox" name="checkAll">id</th><br>
<th><input type="checkbox" name="checkAll">java</th><br>
<th><input type="checkbox" name="checkAll">c</th><br>
<th><input type="checkbox" name="checkAll">c++</th><br>
<th><input type="checkbox" name="checkAll">php</th><br>
<th><input type="checkbox" name="checkAll">java/php/c#</th><br>
</tr>
</body>
</html>
Jquery实现的全选 反选
最新推荐文章于 2021-05-26 21:46:19 发布