JSFiddle - React, Tailwind, and code Playground

HTML

<div id="contentForm"></div>
        <input type="button" id="testButton" value="click"/>

JavaScript

function fcOnClick(){
        var dataHtml='<div><div class="myClass"><form method="get" id="testForm" action="http://www.example.org/search/"><div>Some data</div></form></div></div>';
        var contentForm=$('#contentForm');
        contentForm.html($('.myClass',dataHtml).html());
        alert('form.html():'+$('#testForm').html());
        alert('parentForm.html():'+contentForm.html());
    }

    $('#testButton').click(fcOnClick);