JSFiddle - React, Tailwind, and code Playground

by mofle

HTML

<form id="target" action="destination.html">
  <input type="text" value="Hello there" />
  <input type="submit" value="Go" />
</form>
<div id="other">
  Trigger the handler
</div>

JavaScript

$('#target').submit(function() {
  alert('Handler for .submit() called.');
  return false;
});

$('#other').click(function() {
  $('#target').submit();
});