JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<a href="http://www.google.com">google.com</a>
</div>
JavaScript
String.prototype.replaceAll = function(s1, s2) {
return this.replace(
new RegExp( s1.replace(/[.^$*+?()[{\|]/g, '\\$&'), 'g' ),
s2
);
};
var e = $("div"),
fix = e.html().replaceAll('google.com', "duckduckgo.com");
e.html(fix);