JSFiddle - React, Tailwind, and code Playground

by Barry Margolin

HTML

<div>This is a page <span> with text about Wedding Stationery</span>
and something else
    <br/>and more text about something else.
</div>

JavaScript

var keywords = ['wedding stationery', 'something else', 'other keyword'];
var thePage = $("body");
var theHtml = thePage.html();
for (i = 0; i < keywords.length; i++) {
    theHtml = theHtml.replace(new RegExp(keywords[i], 'ig'),
                '<a class="discrete" href="http://www.kateguest.com">$&</a>');
}
thePage.html(theHtml);