JSFiddle - React, Tailwind, and code Playground
HTML
<form action="#">
<button type="button" id="myButton">My Button</button>
<button type="button" id="myButton2">My Button2</button>
<input type="text" id="myText" />
</form>
JavaScript
$(document).ready(function () {
$('form').submit(function (e) {
e.preventDefault();
$('#myButton2').click();
});
$('#myButton').click(function () {
alert('Button click 1!');
});
$('#myButton2').click(function () {
alert('Button click 2!');
});
});