JSFiddle - React, Tailwind, and code Playground
HTML
<div class="lblTextboxUpdate">hello</div>
<div>Bye</div>
JavaScript
$(document).ready(function() {
$(document).on("click",".lblTextboxUpdate", function() {
var textarea = $('<textarea class="textboxLblUpdate"></textarea>').attr("id",$(this).attr("id")).val($(this).text());
$(this).replaceWith(textarea);
textarea.focus();
});
$(document).on("blur",".textboxLblUpdate", function() {
$(this).replaceWith($('<div class="lblTextboxUpdate"></div>').attr("id",$(this).attr("id")).html($(this).val()));
});
});