title: how to do select all when selected a checkbox
body: <p>i have a table where i am filling some data and have checkboxes besides each and the last check box is "ALL".
  When i check this "ALL" checkbox remaining check boxes should be checked and vice versa.</p>
  
  <p>code for filling data.</p>
  
  <pre><code>&lt;div class="tablecontatiner"&gt;
  
  &lt;table&gt;
                  &lt;tr&gt;
                      &lt;th&gt;Function&lt;/th&gt;
                      &lt;th&gt;Add&lt;/th&gt;
                      &lt;th&gt;Edit&lt;/th&gt;
                      &lt;th&gt;View&lt;/th&gt;
                      &lt;th&gt;Delete&lt;/th&gt;
                      &lt;th&gt;All&lt;/th&gt;
                      &lt;/tr&gt;
                  @foreach (var item in Model)
                  {
                  &lt;tr class="grouprow"&gt;
                      &lt;td&gt;&lt;input type="hidden"/&gt;&lt;input id="@(item.Func_Code)" type="checkbox"  style="visibility:hidden" /&gt;@item.FunctionName&lt;/td&gt;
                      &lt;td&gt;&lt;input id="@(item.Func_Code + "A")" type="checkbox" value="Add" @(item.Add==true?"checked":"") /&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;input id="@(item.Func_Code + "E")" type="checkbox" value="Edit" @(item.Edit==true?"checked":"") /&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;input id="@(item.Func_Code + "V")" type="checkbox" value="View" @(item.View==true?"checked":"")/&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;input id="@(item.Func_Code + "D")" type="checkbox" value="Delete" @(item.Delete==true?"checked":"")/&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;input id="@(item.Func_Code + "ALL")" type="checkbox" value="All"/&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                  }
   &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and my UI looks like <img src="https://i.stack.imgur.com/XMpnn.png" alt="this">:</p>