JSFiddle - React, Tailwind, and code Playground

by gdoron

HTML

<p class='theClass'> bbb <a href=#> foo</a> aaa </p>

JavaScript

var $textNodes = $('.theClass').contents().filter(function() {
    return this.nodeType == Node.TEXT_NODE;
}).each(function(){
    this.nodeValue = "helloWorld";
});