JSFiddle - React, Tailwind, and code Playground

HTML

<div id="foo">
Google is the best website ever <br />
Google is not the best website ever</div>

JavaScript

alert("before replace");
str = $('#foo').html();
$('#foo').html(str.replace(/Google/g,"Yahoo"));