JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<button type="submit">Submit</button>
</form>
JavaScript
$(function() {
$('form').submit(function(){
$("body").append("It's submitted!<br/>");
// stop submission so we don't leave this page
return false;
});
$('form button').click(function() {
$("body").append("Button was clicked.<br/>");
});
});