JSFiddle - React, Tailwind, and code Playground
HTML
<div id="nav">
<a href="#">replace me</a>
<a href="#">this is ok</a>
<a href="#">this is ok</a>
<a href="#">this is ok</a>
</div>
JavaScript
$('#nav a').html(function(i, html) {
return $.trim(html) == 'replace me' ? '<h2>Label</h2>' : html;
});