title: Checkbox Select Inside nested repeater
body: <pre><code> &lt;asp:Repeater ID="rptDetails" runat="server" OnItemDataBound="rptDetails_ItemDataBound"&gt;
          &lt;HeaderTemplate&gt;
              &lt;table width="100%" cellpadding="0" cellspacing="0" border="0" class="table_box"&gt;
          &lt;/HeaderTemplate&gt;
          &lt;ItemTemplate&gt;
              &lt;tr&gt;
                  &lt;td style="width: 200px; text-align: left; vertical-align: top" class="pf14"&gt;
                      &lt;asp:Label ID="lblLoginId" runat="server" Text='&lt;%#Eval("LoginId")%&gt;' Visible="false"&gt;&lt;/asp:Label&gt;                        
                  &lt;/td&gt;
                  &lt;td align="left" valign="top"&gt;
                      &lt;asp:Repeater ID="rptSubDetails" runat="server" OnItemDataBound="rptSubDetails_ItemDataBound"&gt;
                          &lt;HeaderTemplate&gt;
                              &lt;table width="100%" cellpadding="0" cellspacing="0" border="0" style="padding: 5px;"
                                  class="separator"&gt;
                          &lt;/HeaderTemplate&gt;
                          &lt;ItemTemplate&gt;
                              &lt;tr&gt;
                                  &lt;td style="width: 300px; text-align: left; background-color: #e4e4e4; padding: 5px;"
                                      class="pf14"&gt;
                                      &lt;asp:CheckBox ID="chkMain" runat="server" /&gt;
                                      &lt;asp:Label ID="lTitle" runat="server" Text='&lt;%#Eval("Title")%&gt;'&gt;&lt;/asp:Label&gt;                                       
                                  &lt;/td&gt;
                              &lt;/tr&gt;
                              &lt;tr&gt;
                                  &lt;td valign="top"&gt;
                                      &lt;asp:Repeater ID="rptInnerDetails" runat="server" OnItemCommand="rptInnerDetails_ItemCommand"&gt;
                                          &lt;HeaderTemplate&gt;
                                              &lt;table width="100%" cellpadding="0" cellspacing="0" border="0" style="padding: 5px;"&gt;
                                          &lt;/HeaderTemplate&gt;
                                          &lt;ItemTemplate&gt;
                                              &lt;tr&gt;
                                                  &lt;td align="center" width="50px"&gt;                                                        
                                                      **&lt;asp:CheckBox ID="chkSub" runat="server" /&gt;**
                                                  &lt;/td&gt;
                                                  &lt;td align="left" class="pf14"&gt;
                                                      &lt;b&gt;Comment :&lt;/b&gt;
                                                      &lt;asp:Label ID="lblComment" runat="server"&gt;&lt;%# Eval("Comment") %&gt;&lt;/asp:Label&gt;
                                                  &lt;/td&gt;                                                    
                                              &lt;/tr&gt;
                                          &lt;/ItemTemplate&gt;
                                          &lt;FooterTemplate&gt;
                                              &lt;/table&gt;
                                          &lt;/FooterTemplate&gt;
                                      &lt;/asp:Repeater&gt;
                                  &lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;FooterTemplate&gt;
                              &lt;/table&gt;
                          &lt;/FooterTemplate&gt;
                      &lt;/asp:Repeater&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td class="separator"&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/ItemTemplate&gt;
          &lt;FooterTemplate&gt;
              &lt;/table&gt;
          &lt;/FooterTemplate&gt;
      &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p><strong>jQuery</strong>   COde  which is not working as expected....</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
       function toggleSelectionUsingHeaderCheckBox() { 
        $("input[name$='chkMain']").each(function () { 
                 if ($("input[name$='chkMain']").prop('checked')) { 
                    $("input[name$='chkSub']").prop('checked', true); 
                 } 
                 else 
                 { $("input[name$='chkSub']").prop('checked', false); 
                 } 
                }); 
              } 
  &lt;/script&gt;
  </code></pre>
  
  <p>**Hello i want to check uncheck checkbox using jquery i have tried but when i check the main check box all the Sub checkbox get checked...</p>
  
  <p>I want to check only those who are the child of main checkbox.**</p>
  
  <p><img src="https://i.stack.imgur.com/7h1YA.png" alt="I want like this please help me to get exact..."></p>