JSFiddle - React, Tailwind, and code Playground

HTML

Name: <input type="text" id="name">
<br>
<br>
<input type="submit" onclick="return process();" />

JavaScript

var text = document.getElementById("name").value;

function process() {
    alert(text);
    return true;
}