JSFiddle - React, Tailwind, and code Playground

HTML

<div id="someContents">
    <p>Foo has the following properties</p>
    <ul>
        <li>Bar</li>
    </ul>
    <p>And some other stuff</p>
</div>

JavaScript

var $someContents = $('#someContents').text();
alert($someContents);