JSFiddle - React, Tailwind, and code Playground
HTML
<form action="http://www.google.com/">
<fieldset>
<legend>Simple Form</legend>
<p>
<b>Query:</b>
<input type="text" name="q" />
</p>
<input type="submit" name="search" value="Search" />
</fieldset>
</form>
JavaScript
$(function(){
$('form').submit(function(){
alert('This happened before submit. Clicking OK will proceed.');
});
});