JSFiddle - React, Tailwind, and code Playground

by wiltomap

HTML

<table>
  <tbody>
    <tr>
      <td>Support</td>
      <td>
        <select id="support_libelle" name="support_libelle">
          <option value="nullOption" label="-- Non renseigné --" style="display: none;">-- Non renseigné --</option>
          <option selected="selected" value="" label=""></option>
          <option value="01" label="Branchement">Branchement</option>
          <option value="02" label="Canalisation">Canalisation</option>
        </select>
      </td>
    </tr>
    <tr>
      <td>Code Siveer</td>
      <td>
        <input type="text" value="" name="idtron">
      </td>
    </tr>
  </tbody>
</table>

JavaScript

$('select[name=support_libelle]').change(function() {

 $('input[name=idtron]').parents("tr").show();
 
 if ($('select[name=support_libelle]').val() == '01') {
    $('input[name=idtron]').parents("tr").hide();
 }
  
  //alert('test');

});