JSFiddle - React, Tailwind, and code Playground

HTML

<form action="http://www.baidu.com" target="_blank">
    <input type="text" name="abc" />
    <button>Optional Submit Button</button>
</form>

JavaScript

$('form').submit(function(e){
    alert("Form submitted!");
    e.preventDefault(); // Prevent the original submit
});