JSFiddle - React, Tailwind, and code Playground

HTML

<div>
    Text
    <p>
        Text 2
        <span>Text 3</span>
    </p>
</div>

JavaScript

var nodes = $('div').find('*').addBack().contents();

console.log(nodes);