JSFiddle - React, Tailwind, and code Playground

by ravimallya

HTML

<div id="ContentPlaceHolder1_grdDetails_pnlRating_2" class="display-center" style="white-space: nowrap; margin-right: 5px;">
  <table id="ContentPlaceHolder1_grdDetails_rdoRatingQuestions_2" class="radio-list ui-buttonset">
    <tbody>
      <tr>
        <td>
          <input id="ContentPlaceHolder1_grdDetails_rdoRatingQuestions_2_0_2" type="radio" name="ctl00$ContentPlaceHolder1$grdDetails$ctl04$rdoRatingQuestions" value="1" class="ui-helper-hidden-accessible">
          <label for="ContentPlaceHolder1_grdDetails_rdoRatingQuestions_2_0_2" class="ui-button ui-widget ui-state-default ui-button-text-only ui-corner-left active-yellow" role="button" aria-disabled="false"><span class="ui-button-text">1</span></label>
        </td>
        <td>
          <input id="ContentPlaceHolder1_grdDetails_rdoRatingQuestions_2_1_2" type="radio" name="ctl00$ContentPlaceHolder1$grdDetails$ctl04$rdoRatingQuestions" value="2" checked="checked" class="ui-helper-hidden-accessible">
          <label for="ContentPlaceHolder1_grdDetails_rdoRatingQuestions_2_1_2" class="ui-state-active ui-button ui-widget ui-state-default ui-button-text-only active-yellow" role="button" aria-disabled="false"><span class="ui-button-text">2</span></label>
        </td>
        <td>
          <input id="ContentPlaceHolder1_grdDetails_rdoRatingQuestions_2_2_2" type="radio" name="ctl00$ContentPlaceHolder1$grdDetails$ctl04$rdoRatingQuestions" value="3" class="ui-helper-hidden-accessible">
          <label for="ContentPlaceHolder1_grdDetails_rdoRatingQuestions_2_2_2" class="ui-button ui-widget ui-state-default ui-button-text-only active-yellow" role="button" aria-disabled="false"><span class="ui-button-text">3</span></label>
        </td>
        <td>
          <input id="ContentPlaceHolder1_grdDetails_rdoRatingQuestions_2_3_2" type="radio" name="ctl00$ContentPlaceHolder1$grdDetails$ctl04$rdoRatingQuestions" value="4" class="ui-helper-hidden-accessible">
          <label...

JavaScript

$(function() {
  $('.radio-list input[type="radio"]').change(function() {
    var v = $(this).val();
    var t = $(this).closest('table');
    if (v === "5" || v ==="6") {
      t.next().hide();
    } else {
			t.next().show();
    }
  });
});