

1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head runat="server">
5 <title></title>
6 <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
7 <script type="text/javascript">
8 function selectAll(checkbox) {
9 $('input[type=checkbox]').attr('checked', $(checkbox).attr('checked'));
10 }
11 </script>
12 </head>
13 <body>
14 <form id="form1" runat="server">
15 <div>
16 <input type="checkbox" onclick="selectAll(this);" />全选<br/>
17 <input type="checkbox" /><br/>
18 <input type="checkbox" /><br/>
19 <input type="checkbox" /><br/>
20 <input type="checkbox" /><br/>
21 <input type="checkbox" /><br/>
22 <input type="checkbox" /><br/>
23 </div>
24 </form>
25 </body>
26 </html>
27