JSFiddle - React, Tailwind, and code Playground
HTML
<div class="content">
<h3 id="title">THIS IS TITLE</h3>
<input type="button" id="btninput" value="Click Here"/>
</div>
JavaScript
$( document ).ready(function() {
//Here is the variable with html
var datahtml='<body><div class="content"> <h3 >THIS IS TITLE</h3> </div></body>'
$("#btninput").click(function()
{
//Using find() here
alert('The title is: ' + $(datahtml).find('div').text());
});
});