JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<table>
<tr>
    <td>
        <input type="text" name="fname" id="fname">
        <input type="button" id="test" name="test" value="Save" onClick="testButton()" style="display: none">
   </td>
</tr>
<tr>
    <td>
        <input type="text" name="fname" id="fname">
        <input type="button" id="test2" name="test" value="Save" onClick="testButton()" style="display: none">
   </td>
</tr>

</table>

JavaScript

$(document).ready(function() {
    $(":text").keyup(function(e) {
        if($(this).val() != '') {
            $(":text").not(this).attr('disabled','disabled');
            $(this).next("input").show();
        } else {
            $(":text").removeAttr('disabled');
            $(this).next("input").hide();
        }
    });
});