JSFiddle - React, Tailwind, and code Playground

by Ying Chor Ding

HTML

<div class="some">RAW MATERIALS & CHEMICALS>Earth & Stone asd</div>

CSS

.red {
    color:#ff0000
}

JavaScript

$(".some").html(function (i, text) {
    return text.replace(/&gt;(.*)$/, function (match, title) {
        console.log(arguments);
        return '&gt;<span class="red">' + title + '</span>';
    });
});