checkbox check all option
<p>I have checkbox set with Category Subcategorywise... </p>

<pre><code>Company
    Microsoft
    Apple

 Country
     USA
     UK
</code></pre>

<p>and checkbox attached to each item. So if I click on checkbox next to Company, then it should automatically mark checkboxes next to Microsoft and Apple checked, like wise if I select Country, it should check the options USA and UK. and there should also be a select all option, which should select all of them.</p>

<p>Is it possible to add checkbox check property using javascript or jquery ?</p>

<pre><code>&lt;input type="checkbox" class="entityCheckboxHeader1" id="entityCheckboxHeader" name="Company"&gt;Company
 &lt;input id="modalEntity" class="entity1" type="checkbox" name="CompanySub"&gt;Microsoft
 &lt;input id="modalEntity" class="entity2" type="checkbox" name="CompanySub"&gt;Apple
 &lt;input type="checkbox" class="entityCheckboxHeader2" id="entityCheckboxHeader" name="Country"&gt;Country
 &lt;input id="modalEntity" class="entity3" type="checkbox" name="CountrySub"&gt;USA
 &lt;input id="modalEntity" class="entity4" type="checkbox" name="CountrySub"&gt;UK
</code></pre>
