JSFiddle - React, Tailwind, and code Playground
HTML
<form id="form" action="google.com">
First name:<br>
<input type="text" name="firstname">
<br>
Last name:<br>
<input type="text" name="lastname">
<input type="submit">
</form>
JavaScript
$form = $("#form");
$form.bind('ajax:complete', function() {
alert("done");
});
$form.submit();