JSFiddle - React, Tailwind, and code Playground

HTML

<div></div>
<p id="result"></p>

CSS

#result { color: blue }

JavaScript

$($.parseHTML("<p>test1</p><script>hello=1</scr"+"ipt><p>test2</p>", null, true)).appendTo("div");
$("#result").text($("div").html());