<script src="../js/jquery-1.6.2.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">

$(function(){

$("#selectAll").click(function(){//全选

$("#playList:checkbox").attr("checked",true);

});

$("#unSelect").click(function(){//全不选

$("#playList:checkbox").attr("checked",false);

});

$("#reverse").click(function(){

$("#playList:checkbox").each(function(){

$(this).attr("checked",!$(this).attr("checked"));

});

});

});

</script>

<body>

<div id="playList">

<input type="checkbox" value="歌曲1"/>歌曲1<br/>

<input type="checkbox" value="歌曲2"/>歌曲2<br/>

<input type="checkbox" value="歌曲3"/>歌曲3<br/>

<input type="checkbox" value="歌曲4"/>歌曲4<br/>

<input type="checkbox" value="歌曲5"/>歌曲5<br/>

</div>

<input type="button" value="全选" id="selectAll"/>

<input type="button" value="全不选" id="unSelect"/>

<input type="button" value="反选" id="reverse"/>

</body>