Changed around line 1
+ document.getElementById('financial-calculator').addEventListener('submit', function(e) {
+ e.preventDefault();
+
+ const currentSalary = parseFloat(document.getElementById('current-salary').value);
+ const savings = parseFloat(document.getElementById('savings').value);
+ const startupCosts = parseFloat(document.getElementById('startup-costs').value);
+ const runway = parseFloat(document.getElementById('runway').value);
+
+ const monthlySalary = currentSalary / 12;
+ const totalRunwayCosts = monthlySalary * runway;
+ const totalFundsNeeded = startupCosts + totalRunwayCosts;
+
+ const result = savings >= totalFundsNeeded ?
+ `You have enough savings to cover your startup costs and runway.` :
+ `You need an additional $${(totalFundsNeeded - savings).toFixed(2)} to cover your startup costs and runway.`;
+
+ document.getElementById('financial-result').textContent = result;
+ });
+
+ document.getElementById('startup-quiz').addEventListener('submit', function(e) {
+ e.preventDefault();
+
+ const passion = parseInt(document.querySelector('input[name="passion"]:checked').value);
+ const experience = parseInt(document.querySelector('input[name="experience"]:checked').value);
+
+ const totalScore = passion + experience;
+
+ let result;
+ if (totalScore <= 3) {
+ result = 'You might want to gain more experience and passion before launching.';
+ } else if (totalScore <= 5) {
+ result = 'You are on the right track, but consider further preparation.';
+ } else {
+ result = 'You are ready to take the leap and launch your startup!';
+ }
+
+ document.getElementById('quiz-result').textContent = result;
+ });