JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div id="elm">
<p>abcedfg</p>
</div>
<input type="button" id="bt" value="内部のhtml"/>
<input type="button" id="bt2" value="外部のhtml"/>
</body>
JavaScript
$(function(){
$("#bt").click(function(){
alert($("#elm").html());
});
$("#bt2").click(function(){
alert($("#elm").prop("outerHTML"));
});
});