JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div id="content">Test</div>
</body>
JavaScript
$('#content').click(function () {
var content = $('#content').text();
$('#content').html("<textarea id='text'>" + content + "</textarea>");
$('textarea').width($(window).width()).height($(window).height());
$("#content").unbind('click');
});
$("body").delegate("textarea", "keydown",function(e){
alert($('textarea').text());
});
function myAjaxFunction(value) {
$.post("update.php?filename=" + filename, { content: value });
}