The content of this chapter is relatively simple, just go to the page code: Copy the code The code is as follows: < ;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Recipe6.aspx.cs" Inherits="Recipe6" %> Recipe6 <br>$(function () { <br>$("#<%= chkSelectAll.ClientID %>").click(function () { <br>// It’s very simple, just one line of code <br>$("#<%=chkList.ClientID %> input[type=checkbox]" ).attr("checked", $("#<%=chkSelectAll.ClientID %>").is(":checked")); <br>}); <br>}); <br>< ;/script> <br></head> <br><body> <br><form id="form1" runat="server"> <br><div align="left"> <br><p> <br>Realize all selection or cancellation operations</p> <br><fieldset style="width: 400px; height: 150px;"> <br><asp:CheckBox ID="chkSelectAll" runat="server" Text="Select All" /> <br><hr /> <br><asp:CheckBoxList ID="chkList" runat="server"> <br><asp:ListItem Value="1" Text="C#"></asp:ListItem> <br><asp:ListItem Value="2" Text="Java"></asp: ListItem> <br><asp:ListItem Value="3" Text="C "></asp:ListItem> <br><asp:ListItem Value="4" Text="JavaScript">< ;/asp:ListItem> <br></asp:CheckBoxList> <br></fieldset> <br></div> <br></form> <br></body> <br></html> <br> </div> <br> <p><strong>Rendering: </strong></p> <p><img src="/static/imghwm/default1.png" data-src="http://pic002.cnblogs.com/images/2012/59199/2012011221250252.png" class="lazy" alt=""></p>