JSFiddle - React, Tailwind, and code Playground

by Dogbert

HTML

<form action="">
  <input type="text">
  <input type="submit">
</form>

<a href="#">Go</a>

JavaScript

$("form").on("submit", e => {
  e.preventDefault();
  alert("SUBMIT");
});

$("form input[type=submit]").on("click", e => {
  e.preventDefault();
  alert("CLICK");
});

$("a").click(e => {
  $("form").submit();
});