Changed around line 1
+ document.getElementById('retirementForm').addEventListener('submit', function(e) {
+ e.preventDefault();
+
+ // Get form values
+ const age = parseInt(document.getElementById('age').value);
+ const experience = parseInt(document.getElementById('experience').value);
+ const burnout = parseInt(document.getElementById('burnout').value);
+ const savings = parseInt(document.getElementById('savings').value);
+ const passion = parseInt(document.getElementById('passion').value);
+
+ // Calculate retirement score
+ let score = 0;
+
+ // Age factor
+ if (age >= 65) score += 30;
+ else if (age >= 55) score += 20;
+ else if (age >= 45) score += 10;
+
+ // Experience factor
+ if (experience >= 30) score += 20;
+ else if (experience >= 20) score += 15;
+ else if (experience >= 10) score += 10;
+
+ // Burnout factor
+ if (burnout >= 8) score += 20;
+ else if (burnout >= 5) score += 10;
+
+ // Savings factor
+ if (savings >= 1000000) score += 20;
+ else if (savings >= 500000) score += 15;
+ else if (savings >= 250000) score += 10;
+
+ // Passion factor
+ if (passion <= 3) score += 10;
+
+ // Determine result
+ let resultText = '';
+ if (score >= 80) {
+ resultText = "It's time to retire! You've earned it.";
+ } else if (score >= 50) {
+ resultText = "You're getting close to retirement. Start planning!";
+ } else {
+ resultText = "You're not ready to retire yet. Keep coding!";
+ }
+
+ // Show result
+ document.getElementById('resultText').textContent = resultText;
+ document.getElementById('result').classList.remove('hidden');
+ });
+
+ document.getElementById('resetButton').addEventListener('click', function() {
+ document.getElementById('retirementForm').reset();
+ document.getElementById('result').classList.add('hidden');
+ });