<script type="text/javascript" src="js/jquery.js"/> <script type="text/javascript"> <!-- $(function() { $("#selectall").click(function() { $("input[name='chk']").each(function() { $(this).attr("checked", true); }); }); $("#deselectall").click(function() { $("input[name='chk']").each(function() { $(this).attr("checked", false); }); }); }); // --> </script> <body> <input type='checkbox' id='in-shareuser-10' name='chk' value='10' />唱歌 <input type='checkbox' id='in-shareuser-11' name='chk' value='11' />跳舞 <input type='checkbox' id='in-shareuser-12' name='chk' value='12' />美术 <input type="button" id="selectall" name="selectall" value="全选" /> <input type="button" id="deselectall" name="deselectall" value="取消全选" /> </body>