<html>
<head>
<meta charset="utf-8">
<style>
</style>
<script type="text/javascript" src="script/jquery-1.4.2.min.js"></script>
<script>
$(function(){
$("#checkAll").click(function(){
$(":checkbox").attr("checked",true);
});
$("#checkNo").click(function(){
$(":checkbox").attr("checked",false);
});
$("#reverse").click(function(){
$(":checkbox").each(function(){
$(this).attr("checked",!$(this).attr("checked"));
});
});
});
</script>
<body>
<form action="#" method="post">
<input type="checkbox" name="check" value="篮球"/>篮球
<input type="checkbox" name="check" value="羽毛球"/>羽毛球
<input type="checkbox" name="check" value="篮球"/>乒乓球
<input type="checkbox" name="check" value="篮球"/>保龄球
<input type="checkbox" name="check" value="篮球"/>排球
<input type="checkbox" name="check" value="篮球"/>足球
<input type="button" id="checkAll" value="全选">
<input type="button" id="checkNo" value="全不选">
<input type="button" id="reverse" value="反选">
</form>
</body>
</html>