JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="inputA" onchange="setB()"/>
<input type="text" id="inputB" />
JavaScript
function setB() {
document.getElementById('inputB').value = 1;
}
<input type="text" id="inputA" onchange="setB()"/>
<input type="text" id="inputB" />
function setB() {
document.getElementById('inputB').value = 1;
}