JSFiddle - React, Tailwind, and code Playground

HTML

<span class="edit">текст</span>

JavaScript

$('.edit').click(function() {
$(this).addClass('absolute').removeClass('edit');
$(this).html('<input type="text" value="'+$(this).text()+'"><input class="ok" type="button" value="ok">');
    $(this).off('click');
});