Loan Amount:
Interest Rate (%):
Loan Term (Years):
Monthly Payment:
Interest Rate (%):
Loan Term (Years):
Monthly Payment:
Loan Amount:
Interest Rate (%):
Loan Term (Years):
Monthly Payment:
console.log( 'Code is Poetry' );function calculateMortgage() {
var loanAmount = parseFloat(document.getElementById('loanAmount').value);
var interestRate = parseFloat(document.getElementById('interestRate').value) / 100 / 12;
var loanTermMonths = parseFloat(document.getElementById('loanTerm').value) * 12;
var monthlyPayment = (loanAmount * interestRate) / (1 - Math.pow(1 + interestRate, -loanTermMonths));
document.getElementById('monthlyPayment').innerHTML = '$' + monthlyPayment.toFixed(2);
}