JSFiddle - React, Tailwind, and code Playground
JavaScript
$(document).ready(function(){
var datahtml = $("<html><body><div class=\"class0\"><h4>data1</h4><p class=\"class1\">data2</p><div id=\"mydivid\"><p>data3</p></div></div></body></html>".replace("\\", ""));
var tempContainer = $('<div style="display:none;"></div>');
$(tempContainer).append(datahtml);
$('body').append(tempContainer);
alert($(tempContainer).find('.class1').text());
$(tempContainer).remove(); });