JSFiddle - React, Tailwind, and code Playground
HTML
<div id="input" contenteditable="true" style="border: 1px solid;width:300px; height:100px;"><b>Edit me!</b> You can use CTRL+B to change bold, ctrl+I to change italics.</div>
<div style="clear:both;">
<input type="button" value="Get HTML">
</div>
<div id="output" style="border: 1px solid;clear:both;width:300px;height:100px;font-family:courier;font-size:10px;">
</div>
JavaScript
$(':button').click(function() {
$('#output').text(JSON.stringify({
data:$('#input').html()
}));
});