JSFiddle - React, Tailwind, and code Playground

HTML

<table>
	<tr id="payeeName">
		<td><strong>Payee Name</strong></td>
		<td id="payeeNameField">Rupert</td>
		<td><a href="#">Change</a></td>
	</tr>
</table>

JavaScript

$('a').click(function() {
	var parentId = $(this).closest('tr').attr('id');
	var child = $("#" + parentId).children().eq(1);
	var childText = $(child).text();
	$(child).html('<form action="<?php echo URL; ?>user/changeSettings/' + parentId + '" method="POST" id="submitEdit"><input type="text" name="' + parentId + '" value="' + childText + '" /></form>');
	console.log(childText);
});

$(document).on("submit", "#submitEdit", function() {
	var url = $(this).attr('action');
	var data = $(this).serialize();
	alert(data);
	$.post(url, data, function(returned) {
		$(parentId + "Field").html(returned);
		return false;
	});
	return false;
});