JSFiddle - React, Tailwind, and code Playground

HTML

<p>This is * a test * to change the * color of asterisks.</p>


<p>this is an added *P* element</p>

JavaScript

$("p").each(function() {
    var html = $(this).html().replace(/\*/g, "<span class=\"asterisk\">*</span>");
    $(this).html(html).find(".asterisk").css("color", "red");
});