JSFiddle - React, Tailwind, and code Playground

by gunjan_prmr

HTML

<tr role="row" id="0" tabindex="-1" class="ui-widget-content jqgrow ui-row-ltr ui-state-highlight" aria-selected="true">
  <td role="gridcell" style="text-align:center;width: 20px;" aria-describedby="grid_cb">
    <input role="checkbox" type="checkbox" id="jqg_grid_0" class="cbox" name="jqg_grid_0"> 1st
  </td>
  <!-- HIDDEN TD  --> 
  <td role="gridcell" style="text-align:center;display:none;" title="" aria-describedby="grid_check">
    <input type="checkbox" value="NDVoYzZ1aUNYdzAlM2Q1" name="Restaurants" id="Restaurants"> 2nd
  </td>
</tr>
</br>
<tr role="row" id="1" tabindex="-1" class="ui-widget-content jqgrow ui-row-ltr">
  <td role="gridcell" style="text-align:center;" aria-describedby="grid_cb">
    <input role="checkbox" type="checkbox" id="jqg_grid_1" class="cbox" name="jqg_grid_1"> 3rd
  </td>
   <!-- HIDDEN TD  --> 
  <td role="gridcell" style="text-align:center;display:none;" title="" aria-describedby="grid_check">
    <input type="checkbox" value="QjBENlRFMW83SVElM2Q1" name="Restaurants" id="Restaurants"> 4th
  </td>
</tr>

JavaScript

var res = [];
$('input[type=checkbox]:checked')
  .each(function() {
    res.push($(this).eq(1).val());
  });

if (res.length == 0) {
  alert('You should select at least one option.');
  return;
}

alert("Values: " + res);