JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" onclick="changeText(1)" value="1" >
<input type="button" onClick="changeText(2)" value="2">
<input type="button" onClick="changeText(3)" value="3">
<br>
<input type="text" id="count" value=""/>
JavaScript
function changeText(value) {
document.getElementById('count').value = value ;
}