JSFiddle - React, Tailwind, and code Playground

HTML

<div class="red-highlight test">asd</div>
<div class="blue-highlight test">asd</div>
<div class="red-highlight test">asd</div>

CSS

.red-highlight {
    color: red;
}

.blue-highlight {
    color: blue;
}

JavaScript

$.each($("*[class*='-highlight']"), function() {
  $(this)[0].className = $(this)[0].className.replace(/\b.*-highlight\b/g, '');  
});