EMI CALCULATOR CODE
EMI CALCULATOR CODE
EMI Calculator
EMI Calculator
var tenure = parseInt(document.getElementById('tenure').value);
if (isNaN(loanAmount) || isNaN(interestRate) || isNaN(tenure)){
document.getElementById('emiResult').innerHTML = 'Please enter valid inputs.';
return;
}
var monthlyInterest = interestRate / 100 / 12;
var emi = (loanAmount * monthlyInterest * Math.pow(1 + monthlyInterest, tenure)) /
(Math.pow(1 + monthlyInterest, tenure) - 1);
emi = emi.toFixed(2);
document.getElementById('emiResult').innerHTML = 'EMI: $' + emi;
}