JSFiddle - React, Tailwind, and code Playground
HTML
<button id='showsource'>Show Source</button>
<div id="box1">
<p>Here's some <b>HTML</b> to look at.</p>
</div>
<div id="displaysource">
</div
CSS
div#box1 {
width:200px;
height:100px;
border: 1px solid black;
}
div#displaysource {
width:400px;
height:200px;
overflow: scroll;
border:1px black solid;
}
JavaScript
$('#showsource').click(function () {
debugger;
var inhtml = $('#box1').html();
$('#displaysource').append(inhtml)
x = 3;
});