JSFiddle - React, Tailwind, and code Playground

HTML

<input id="chp1" value="25" />
<input id="chp2" value="63" />
<input type="checkbox" id="chk" />
<input id="chp3" value="63" />

JavaScript

document.getElementById("chk").onchange = function(){
    document.getElementById("chp3").value = 
        this.checked 
        ? document.getElementById("chp1").value 
        : document.getElementById("chp2").value;
};