JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" name="textinput" id="textinput" value="">
<input type="button" id="but" value="go" onclick="foo()">
<div>

JavaScript

foo= function () {
    alert(document.getElementById('textinput').value)
}