JSFiddle - React, Tailwind, and code Playground
by jfriend00
HTML
<div class="pun-crumbs"><p class="crumbs">
<a href="/">Forum</a>
<strong>
»
<a class="nav" href="/c4-our-mods">Test</a>
»
<a class="nav" href="/f7-forum">
<span>Test 1</span>
</a>
</strong>
</p>
</div>
JavaScript
var cntr = 0;
$(".pun-crumbs strong").contents().each(function() {
// nodeType 3 is text nodes
// nodeValue is the contents of a text node
if (this.nodeType == 3 && this.nodeValue.indexOf("»") != -1) {
++cntr;
if (cntr == 2) {
this.nodeValue = this.nodeValue.replace("»", "");
}
}
});