JSFiddle - React, Tailwind, and code Playground

HTML

<form>
   <table class="tableClassName"> 
     [content]
   </table>
   <div class="divClassName"> 
     [content]
   </div>
Here is some text
</form>

JavaScript

$("form").contents().each(function() {
    if(this.nodeType == 3) {
        if($.trim(this.nodeValue) == 'Here is some text') {
            this.nodeValue = 'New text';   
        }
    }
});