JSFiddle - React, Tailwind, and code Playground
HTML
<div class="hasTooltip">
<textarea>
<html>
<h1>
This is test
</h1>
<p>
More HTML ...
</p>
</html>
</textarea>
</div>
CSS
textarea{
height:200px;
width:100%;
border:none !important;
background:none;
resize: none;
}
JavaScript
$('.hasTooltip').click(function() {
var win = window.open("", "Title", "toolbar=no");
win.document.body.innerHTML = $("textarea").val();
});