您好,登录后才能下订单哦!
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>复选框——全选/反选</title>
<LINK href="css/style.css" type=text/css rel=stylesheet>
<script language="javascript" src="jquery.js"></script>
</head>
<script>
$(function(){
$("#allcheckbox").click(function(){
var checkboxObj=$("table tr:gt(0) :checkbox");
if($(this).attr("checked")==true){
checkboxObj.each(function(){
$(this).attr("checked",true);
});
}else{
checkboxObj.each(function(){
$(this).attr("checked",false);
});
}
});
})
</script>
<body>
<table width="567" height="169" border="1" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
<td align="center" valign="middle"><label>
<input id="allcheckbox" type="checkbox" name="checkbox" value="checkbox" />
</label></td>
</tr>
<tr>
<td> </td>
<td align="center" valign="middle"><input type="checkbox" name="checkbox2" value="checkbox" /></td>
</tr>
<tr>
<td> </td>
<td align="center" valign="middle"><input type="checkbox" name="checkbox3" value="checkbox" /></td>
</tr>
<tr>
<td> </td>
<td align="center" valign="middle"><input type="checkbox" name="checkbox4" value="checkbox" /></td>
</tr>
<tr>
<td> </td>
<td align="center" valign="middle"><input type="checkbox" name="checkbox4" value="checkbox" /></td>
</tr>
<tr>
<td> </td>
<td align="center" valign="middle"><input type="checkbox" name="checkbox4" value="checkbox" /></td>
</tr>
<tr>
<td> </td>
<td align="center" valign="middle"><input type="checkbox" name="checkbox4" value="checkbox" /></td>
</tr>
<tr>
<td> </td>
<td align="center" valign="middle"><input type="checkbox" name="checkbox4" value="checkbox" /></td>
</tr>
<tr>
<td> </td>
<td align="center" valign="middle"><input type="checkbox" name="checkbox4" value="checkbox" /></td>
</tr>
</table>
</body>
</html>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。