JSFiddle - React, Tailwind, and code Playground
HTML
<div id="meText">Click to edit <br /> this text.</div>
CSS
#meText{
width: 200px;
height:100px;
background: red;
}
JavaScript
$(function(){
$("#meText").on('click',function(){
var originalDiv = this;
$(this).replaceWith($("<textarea></textarea>").html($(this).text().replace(/\n/g, "<br />")));
});
});