title: Check All Checkboxes based on Div Id and Class using Jquery
body: <p>I want to check all checkboxes based on Div ID and Checkbox Class. All checkboxes in different divs have the same class. I want to check all checkboxes on button click which is in that particular div. I don't want to use input[type='checkbox'] like below. I want to use only Class Name. Can I do this ?</p>
  
  <pre><code> $('div#'+Id+' input[type=checkbox]').each(function () {            
          $(this).prop('checked', true);
      });
  </code></pre>
  
  <p>Below is my code.</p>
  
  <pre><code>&lt;div id="div1"&gt;
  &lt;input type="button" id="btnDiv1" value="Select All" /&gt;
  &lt;input type="checkbox" class="check" /&gt;Mark
  &lt;input type="checkbox" class="check" /&gt;Frank
  &lt;/div&gt;
  
  &lt;div id="div2"&gt;
  &lt;input type="button" id="btnDiv2" value="Select All" /&gt;
  &lt;input type="checkbox" class="check" /&gt;John
  &lt;input type="checkbox" class="check" /&gt;Travis
  &lt;input type="checkbox" class="check" /&gt; Matt
  &lt;/div&gt;
  
  &lt;div id="div3"&gt;
  &lt;input type="button" id="btnDiv3" value="Select All" /&gt;
  &lt;input type="checkbox" class="check" /&gt;Lee
  &lt;input type="checkbox" class="check" /&gt;Charles
  &lt;/div&gt;
  </code></pre>