JSFiddle - React, Tailwind, and code Playground
HTML
<div id="test">Here is some text</div>
JavaScript
$('#test').html(function(index, oldHtml){
//some custom code here
var newHtml = oldHtml + '<div>NEW</div>';
return newHtml;
});