JSFiddle - React, Tailwind, and code Playground

by davidpauljunior

HTML

<form action="https://httpbin.org/post" method="post">
  <button name="should-be-sent" type="submit">Submit</button>
</form>

JavaScript

var form = document.querySelector('form');

form.addEventListener('submit', function(e) {
  e.preventDefault();
  form.submit();
});