Home Equity Loan Calculator
Home Equity Loan Calculator
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
text-align: center;
}
.calculator {
max-width: 400px;
margin: 0 auto;
}
label {
display: block;
margin-top: 10px;
}
input {
width: 100%;
padding: 5px;
}
button {
margin-top: 10px;
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
}
h2 {
margin-top: 20px;
}
#results {
border: 1px solid #ccc;
padding: 10px;
margin-top: 10px;
}function calculateLoan() {
var propertyValue = parseFloat(document.getElementById("propertyValue").value);
var currentMortgage = parseFloat(document.getElementById("currentMortgage").value);
var loanTerm = parseFloat(document.getElementById("loanTerm").value);
var equity = propertyValue - currentMortgage;
var loanAmount = equity * 0.8; // Assuming 80% loan-to-value ratio
document.getElementById("equity").textContent = equity.toFixed(2);
document.getElementById("loanAmount").textContent = loanAmount.toFixed(2);
}
No comments