JSFiddle - React, Tailwind, and code Playground

HTML

<a href="" id="den">DEN</a>
<div id="test">
<p id="x">I am doing good</p>
</div>

JavaScript

$("#den").on("click", function () {
       $("#test > p#x").html('<textarea >' +  $("#test >p#x").html() +'</textarea>');
     return false;
});