JSFiddle - React, Tailwind, and code Playground

HTML

<p>p</p>
<br>br1
<br>br2
<br>br3

JavaScript

$( function() {
    console.log($('p').text());
    $( 'br' ).each( function() {
        console.log( $( this ).get( 0 ).nextSibling.nodeValue );
    });
});