title: Jquery: How to check/uncheck a list of checkbox's on checkbox click
body: <p>I need to uncheck all the <strong>Reject</strong> checkbox's on clicking <strong>Approve</strong> checkbox header and vice versa. How can I achieve this using jquery/javascript.</p>
  
  <p><img src="https://i.stack.imgur.com/OwrNP.jpg" alt="Here is an image depicting my requirement"></p>
  
  <p>My HTML code is as follows</p>
  
  <pre><code> &lt;asp:TemplateField &gt;
          &lt;HeaderTemplate&gt;
              Approve
              &lt;br /&gt;
              &lt;input id="ChkAllApprovedItems"  type="checkbox"  /&gt;
          &lt;/HeaderTemplate&gt;
          &lt;ItemTemplate&gt;
              &lt;asp:CheckBox ID="chkApproval" Checked='&lt;%#Eval("IsApproved").ToString()=="1"?true:false %&gt;'  runat="server" onclick="EnableApprove(this,this.checked);" /&gt;
           &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
  
       &lt;asp:TemplateField &gt;
          &lt;HeaderTemplate&gt;
              Reject
              &lt;br /&gt;
              &lt;input id="ChkAllRejectedItems"  type="checkbox"  /&gt;
          &lt;/HeaderTemplate&gt;
          &lt;ItemTemplate&gt;
              &lt;asp:CheckBox ID="chkReject" Checked='&lt;%#Eval("IsRejected").ToString()=="1"?true:false %&gt;'  runat="server"  onclick="EnableReject(this,this.checked);" /&gt;
           &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>Can someone help me with a sample code.</p>
  
  <p>Thanks.</p>