Может быть, вы просто хотите это сделать:
let doc, html, bod, I; // for use on other loads
addEventListener('load', ()=>{
doc = document; html = doc.documentElement; bod = doc.body; I = id=>doc.getElementById(id);
const year1 = I('year1'), year2 = I('year2');
year1.oninput = function(){
let v = this.value;
if(v.match(/^[0-9]+$/)){
year2.value = +v+1;
}
else if(v === ''){
year2.value = '';
}
}
}); // end load
<input id='year1' type='number' value='' />
<input id='year2' type='number' value='' />