JSFiddle - React, Tailwind, and code Playground
HTML
<p id="p">Lots and lots of text here.</p>
JavaScript
var a = $('#p').text();
$('#p').replaceWith('<span id="#p">' + a + '</span>');
<p id="p">Lots and lots of text here.</p>
var a = $('#p').text();
$('#p').replaceWith('<span id="#p">' + a + '</span>');