JSFiddle - React, Tailwind, and code Playground

HTML

<div id="mainContent">this is a test text & it has several different & characters in the sentence &</div>

CSS

.otherfont{font-weight:bold;}

JavaScript

var mainContent = $('#mainContent').text();
var newContent = mainContent.replace(/&/g, '<span class="otherfont">&</span>');
$('#mainContent').html(newContent);