JSFiddle - React, Tailwind, and code Playground

HTML

<ul class="foo">
    <li>ABC</li>
    <li>DEF</li>
</ul>

JavaScript

var html = $.trim($( "ul.foo" ).html());
console.log(html);
var nodes = $(html);