JSFiddle - React, Tailwind, and code Playground
HTML
<div id="foo">Other Element this string</div>
CSS
#foo {
background: blue;
color: grey;
padding: 10px;
}
#foo #child {
background: red;
color: black;
}
JavaScript
var foo = $('#foo').html();
foo = foo.replace('this string', 'this other string');
$('#foo').html(foo);