JSFiddle - React, Tailwind, and code Playground

HTML

<table class="table" border="1" width="80%">
    <tr>
        <td>Hello"there</td>
        <td>Hello"there</td>
        <td>Hello"there</td>
        <td>Hello"there</td>
    </tr>
</table>

JavaScript

$(".table td").click(function(){
    var input = createInput($(this).html());
    $(this).html(input);
});

createInput = function(str){
	str = typeof str !== 'undefined' ? str : "";
	input = '<input value="'+str+'">';
	return input;
}