JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="theinput"/>
<br/>
<input type="button" class="button" value="button01"/>
<br/>
<input type="button" class="button" value="button02"/>
<br/>
<input type="button" class="button" value="button03"/>
<br/>
<input type="button" class="button" value="button04"/>
<br/>
<input type="button" class="button" value="button05"/>
JavaScript
var theButtons = $(".button");
theButtons.click(function(index) {
var currentButton = $(this);
var buttonValue = currentButton.val();
$("#theinput").val(buttonValue);
});