JSFiddle - React, Tailwind, and code Playground

by Craig Haywood

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);