Embed an App
退休計算機 Retirement Calculator
現時年齡 Current Age:
退休年齡 Retirement Age:
預期壽命 Life Expectancy:
每月收入 Monthly Income:
計算 Calculate
function calculateRetirement() {
const currentAge = document.getElementById("currentAge").value;
const retirementAge = document.getElementById("retirementAge").value;
const lifeExpectancy = document.getElementById("lifeExpectancy").value;
const monthlyIncome = document.getElementById("monthlyIncome").value;
const yearsToRetirement = retirementAge - currentAge;
const yearsInRetirement = lifeExpectancy - retirementAge;
const totalSavingsNeeded = yearsInRetirement * 12 * monthlyIncome;
const result = document.getElementById("result");
result.innerHTML = `您需要為退休年度存款港幣You need to save a total of HK$${totalSavingsNeeded.toFixed(2)} for your retirement years.`;
}
Proudly built with Strikingly