JSFiddle - React, Tailwind, and code Playground

HTML

<div id='parent'>
   this text is for parent

   <div id='child-parent'> 
     this text if for child-parent  

       <div id='child'>
        and this text is for child.   
       </div>   

   </div>

</div>

JavaScript

$(function(){
    var blub = $('#parent').contents().first().text();
    alert(blub);
});