JSFiddle - React, Tailwind, and code Playground

HTML

<p>Hello</p>
<p>Here is a paragraph</p>
<p>And Another</p>

JavaScript

$("p").replaceWith (function(i,content){ 
    return "<button>" + content + "</button>" ;
});