JSFiddle - React, Tailwind, and code Playground

by Addy Osmani

HTML

<div id="asd" style="white-space: pre">
   &lt;span&gt;Test&lt;/span&gt; Content after
   </div>

JavaScript

$('#asd').contents().each(function() {
       // $(this).replaceWith('<span>Test</span>Content after');
       $(this).replaceWith('<span><span>Test</span>Content after</span>');
        return false;
   });