JSFiddle - React, Tailwind, and code Playground
HTML
<div class="example">Some Example text
<span class="abe">
<span class="abe"> this is an inner text of the span </span> text in the span
</span>
</div>
<div class="example">Some more Example text</div>
CSS
.abe{color:blue;}
.ab{color:red;}
JavaScript
function change(node) {
if (node.nodeType == 3) {
node.data = node.data.replace(/e|E/g, '');
}
else {
$(node).contents().each(function() {
change(this);
});
}
}
$('div').contents().each(function() {
change(this);
});