JSFiddle - React, Tailwind, and code Playground
HTML
<div id="myDivId">
First name: <input id="firstNameId" type="text" name="FirstName"><br>
<input type="submit" value="submit">
</div>
JavaScript
function onSubmit() {
debugger;
var $fs = $('#firstNameId');
var str = $('#myDivId').html();
alert("this goes to windows history: " + str);
// window.history.pushState($('#myDivId').html(), "title", 'some url');
}