JSFiddle - React, Tailwind, and code Playground
by kontrach
HTML
<form action="" onsubmit="onSubmit(event)">
<input type="text" name="age" value="22">
<button type="submit">
Submit
</button>
<button type="reset">
Reset
</button>
<button>
Cancel
</button>
</form>
JavaScript
window.onSubmit = function onSubmit(event){
event.preventDefault();
console.log('Form was submitted! ', arguments);
}