JSFiddle - React, Tailwind, and code Playground

by Martin Murciego

HTML

<table>
<tr><th><label for="id_first">First input:</label></th><td><input type="text" name="First input" id="id_first" value="ddelete"/></td></tr>
<tr style="display:none;"><th><label for="id_second">Second input:</label></th><td><input type="text" name="First input" id="id_second" />
</td>
</tr>
<tr><th><label for="id_second">Third input:</label></th><td><input type="text" name="First input" id="id_second" />
</td>
</tr>
</table>

JavaScript

$('#id_second').closest('tr').hide();
$('#id_first').keyup(function() {    

if ($(this).val().length < 1){
    $('#id_second').closest("tr").show()}    
else{
	
  }
        
        });