JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id='theText' placeholder="hello">
<input type="button" value="clear" onclick='clearText'>
JavaScript
clearText = function(){
document.getElementById('theText').value = "";
}