JSFiddle - React, Tailwind, and code Playground
by Vibs
HTML
Testing JQuery Unload in 3.x Version
<p>
<input type="text" placeholder="Enter Anything to trigger exit event" style="width:100%" />
</p>
JavaScript
$(window).on("beforeunload", function(){
return confirm("Are you sure that you want to exit?")
})