JavaScript - How Do I Capture User Inputs and Display a Computed Result?

I need to collect two numeric inputs and show a calculated result based on conditions. For example:

<input id='val1' oninput='runCalc()'>
<input id='val2' oninput='runCalc()'>
<div id='disp'></div>
<script>
function runCalc(){
  let x = +document.getElementById('val1').value,
      y = +document.getElementById('val2').value;
  document.getElementById('disp').textContent = (x > 300000 && y < 60) ? Math.min((x - 250000) * 0.1, 2000) : 'No Rebate';
}
</script>

hey, nice script. you might wanna check for empty inputs so it doesnt give weird results if a field is blank. some extra error handling wouldnt hurt