JSFiddle - React, Tailwind, and code Playground

HTML

<div class="test">
    First
    <p></p>
    Second
    <p></p>
    Third
</div>

JavaScript

var second = $('.test').contents().filter(function() {
               return this.nodeType == Node.TEXT_NODE;
           }).eq(1).text();

console.log(second);