JSFiddle - React, Tailwind, and code Playground

HTML

<form action='/echo/html/' method='post' id='Form' name='Form'>
    <input type='hidden' value='posted' id='html' name='html'>
    <input type='submit' id='submit1' value='submit type'>
    <input type='button' id='submit2' value='button type' onclick='submitForm();'>
</form>

JavaScript

var theForm = document.forms['Form'];
if (!theForm) { 
    theForm = document.Form; 
} 
function submitForm() { 
    theForm.submit();
} 

$(function () {
    $('form').submit(function () {
        alert('ok');
    });
});