JSFiddle - React, Tailwind, and code Playground

HTML

<button>123</button>
<input/>

JavaScript

document.querySelector("button").onclick = function()
{
    document.querySelector("input").value = "123";
};