JSFiddle - React, Tailwind, and code Playground

by mrobin

HTML

<p>Some Text</p>

JavaScript

$('p').dblclick(function(){
      var textArea = $('<textarea />')
      var oldText = $(this).text();
      
      $(this).replaceWith(textArea);
      textArea.val(oldText);
});