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>