JSFiddle - React, Tailwind, and code Playground

HTML

<p id="foo">hallo</p>

JavaScript

$('#foo').replaceWith("p id='foo'>testest</p>">;