JSFiddle - React, Tailwind, and code Playground

by alek1688

HTML

<div class="prova">uno <span>due</span> tre</div>

JavaScript

$('.prova').contents()
    .filter(function() {
      return this.nodeType === 3;
    }).replaceWith('lol')