JSFiddle - React, Tailwind, and code Playground
HTML
<form class="comment-form" action="#" method="get">
<input type="submit" id="submit" name="submit" value="submit"/>
</form>
JavaScript
$('.comment-form').on('click', '#submit', function(e) {
// get the form from the delegate
var form = e.delegateTarget;
// prevent the form from submitting unless we want it to
e.preventDefault();
// this would be a call to some sort of function that maybe does
// some validation. For the purpose of demonstration, just setting
// it true
if (true) {
form.submit(); // object is not a function - this makes sense since jQuery is overriding this
$(form).submit(); // nothin at all :(
$(form).trigger('submit'); // nope, nada
}
});