title: Select all checkboxlist in Popup using jquery
body: <p>I have a checkboxlist in Popup. I used a selectall checkboxlist items function in jquery. The problem is when I check selectall checkbox , it selects all the checkboxlist items in popup and also in the webpage . how to make it select only the checkboxlist items only in the popup.. My code as </p>
  
  <pre><code> &lt;td&gt;   &lt;div style="text-align: left; margin: auto;"&gt;
                      &lt;asp:CheckBox ID="chkSelectReportAll" runat="server" Text="Select All" onclick="checkall()"/&gt;
                      &lt;asp:CheckBoxList ID="chkReportLst" runat="server"&gt;
                      &lt;/asp:CheckBoxList&gt;
          &lt;/div&gt;
   &lt;/td&gt;
  </code></pre>
  
  <p>My script as</p>
  
  <pre><code>function checkall() {
     $('#MainContent_uscOptionsPOPUP_chkSelectReportAll').click(
      function () {
       if (document.getElementById('chkReportLst'))                    
     $("INPUT[type='checkbox']").attr('checked', $('#MainContent_uscOptionsPOPUP_chkSelectReportAll').is(':checked'));
              });
          } 
  </code></pre>
  
  <p>Any suggestions ??</p>