JSFiddle - React, Tailwind, and code Playground
by roXon
HTML
<span class="a"> String <span class="b">Herp</span> </span>
JavaScript
var txt1 = $(".a").contents().filter(function() {
return this.nodeType == 3;
}).text();
alert(txt1)
by roXon
<span class="a"> String <span class="b">Herp</span> </span>
var txt1 = $(".a").contents().filter(function() {
return this.nodeType == 3;
}).text();
alert(txt1)