JSFiddle - React, Tailwind, and code Playground

by Eric Howe

HTML

<div id="out"></div>

CSS

pre {
    border: 1px solid black;
    margin: 0.5em 0;
}

JavaScript

var data = '<ul id="a"><li>a</li></ul><ul id="b"><li>b</li></ul>';
$('<div>' + data + '</div>').find('ul').each(function(i,v) {
    var theTag = v.tagName;
    var theElement = $(v);
    var theValue = theElement.html();
    $('#out').append('<pre>' + theTag + '\n' + theElement + '\n' + theValue + '</pre>');
});