JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/ui-lightness/jquery-ui.css">
<div id="test" style="width:300px; height:200px;">
testing
</div>
JavaScript
$("#test").dblclick(function() {
$(this).wrapInner("<textarea/>").find('textarea').focus();
}).delegate('textarea', 'blur', function() {
$(this).parent().text(this.value);
});