JSFiddle - React, Tailwind, and code Playground

HTML

<div id='result' style='display: none'/>

JavaScript

$(document).ready(function() {
    $.ajax({
        type: "POST",
        url: '/echo/html/',
        dataType: "html",
        data: {
            html: "<span id='foo'>test</span><br/><span>Test2</span>",
            delay: 1
        },
        success: function(data, textStatus, jqXHR) {
            $('#result').append($(data));

            // use $("#result selector") here, for example:
            alert($("#result #foo").text());
        }
    });
});