JSFiddle - React, Tailwind, and code Playground

HTML

<form id="myForm">
    <input type="text" name="foo" />
    <a href="javascript:;">Submit!</a>
</form>

JavaScript

$(function(){
    $("#myForm a").on("click", function(e){
        alert("click: do some shit and then, submit...");
        $("#myForm").submit();
    });
    $("#myForm").on("submit", function(e){
        e.preventDefault();
        alert("submit");
    });
});