JSFiddle - React, Tailwind, and code Playground
HTML
FirstBox <input id="first" type="text" name="fname"><br>
SecondBox <input id="second" type="text" name="lname"><br>
<button onclick="givevalue()" type="button">Click Me!</button>
JavaScript
givevalue = function(){
console.log("hello")
var value = document.getElementById('first').value;
document.getElementById('second').value = value;
}