JSFiddle - React, Tailwind, and code Playground

by fredd man

HTML

<input type="button" value="Submit" id="btnsubmit" onclick="submitForm()">

JavaScript

function submitForm() {
   // Get the first form with the name
   // Hopefully there is only one, but there are more, select the correct index
   var frm = document.getElementsByName('contact-form')[0];
   frm.submit(); // Submit
   frm.reset();  // Reset
   return false; // Prevent page refresh
}