JSFiddle - React, Tailwind, and code Playground
HTML
<input type="checkbox" id="myLink" /> Check all
<br /><br />
<table style="font-weight:bold;" id="chkCountry">
<tbody>
<tr>
<td>
<input type="checkbox" value="GB" name="chkCountry$0" id="chkCountry_0">
<label for="chkCountry_0">UK</label>
</td>
<td>
<input type="checkbox" value="US" name="chkCountry$1" id="chkCountry_1">
<label for="chkCountry_1">USA</label>
</td>
</tr>
</tbody>
</table>
JavaScript
$(document).ready(function () {
$('#myLink').click(function () {
$("INPUT[id^='chkCountry_']").attr('checked', $('#myLink').is(':checked'));
});
});