JSFiddle - React, Tailwind, and code Playground
HTML
<br>
Some text that needs to be hidden in the HTML
<br>
CSS
span.hidden {
display: none;
visibility: hidden;
}
JavaScript
$(function() {
var me = $('body')
.contents()
.filter(function() {
return this.nodeType == Node.TEXT_NODE;
});
$(me[1]).wrap('<span class="hidden"></span>');
});