JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="txt1" />
<input type="text" id="txt2"/>
<input type="text" id="txt3"/>
JavaScript
$('#txt2').keyup(function(){
var var1=document.getElementById('txt1').value;
var var2=document.getElementById('txt2').value;
alert(var2);
document.getElementById('txt3').value=result;
});