JSFiddle - React, Tailwind, and code Playground
HTML
<div>text node <b>and b element</b></div>
JavaScript
var textnode = $('div').contents().filter(':not(*)');
console.log(textnode);
var textnode = $('div').contents().not('*');
console.log(textnode); //returns jq empty
var textnode = $('div').contents().not(':not(:not(*))');
console.log(textnode); //returns text node in set