JSFiddle - React, Tailwind, and code Playground
HTML
<textarea class="export"></textarea>
CSS
.export{
width: 500px;
}
JavaScript
var strVar="";
strVar += "<ul>";
strVar += " <li>Coffee<\/li>";
strVar += " <li>Tea<\/li>";
strVar += " <li>Milk<\/li>";
strVar += "<\/ul>";
$('.export').html(strVar);
var data = $(".export").html();
function myDecode(s){
return s.replace(/\</g,"<").replace(/\>/g, ">");
}
console.log("data: "+data);
console.log("data: " + myDecode(data));
$("body").append(myDecode(data));