JSFiddle - React, Tailwind, and code Playground

HTML

<div>Testing
    <p>Some more text inside p</p>
    Test
</div>

JavaScript

var x = $('p')[0].textContent;
console.log(x);