<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>请输入关键词</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
<input type="checkbox" class="ipt">歌曲1<br>
<input type="checkbox" class="ipt">歌曲2<br>
<input type="checkbox" class="ipt">歌曲3<br>
<input type="checkbox" class="ipt">歌曲4<br>
<input type="checkbox" class="ipt">歌曲5<br>
<input type="button" class="btn1" value="全选">
<input type="button" class="btn2" value="全不选">
<input type="button" class="btn3" value="反选">
<script type="text/javascript">
$(function(){
$(".btn1").click(function(){
$("input:checkbox").attr("checked",true);
});
$(".btn2").click(function(){
$("input:checkbox").attr("checked",false);
});
$(".btn3").click(function(){
$("input:checkbox").each(function(){
$(this).attr("checked",!$(this).attr("checked"));
})
});
})
</script>
</body>
</html>