JSFiddle - React, Tailwind, and code Playground

HTML

<button id='first'>
html of first p element
</button>
<p id="firstp">
simple text<h3>
this is h3 text
</h3>
</p>
<button id='second'>
html of second p element
</button>
<p id='secondp'>

</p>

JavaScript

$('#first').on('click',function(){
alert($('#firstp').html());});
$('#second').on('click',function(){
$('#secondp').html('simpletext<h3> this is h3 text </h3>');
alert($('#secondp').html());
});