JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" id="button1" value="button" />
<input type="text" id="text1" />

JavaScript

var btn1 = document.getElementById('button1');
var txt1 = document.getElementById('text1');
btn1.onclick=function(){ txt1.value = 'hello world'}