JSFiddle - React, Tailwind, and code Playground
HTML
<form id="theform">
<input type="text" id="searchTerm" />
<input type="submit" value="Submit" id="submitButton" />
</form>
JavaScript
document.getElementById('theform').onsubmit = function() {
console.log(document.getElementById('searchTerm').value);
return false;
};