Changed around line 1
+ document.getElementById('calculator').addEventListener('submit', function(event) {
+ event.preventDefault();
+
+ const income = parseFloat(document.getElementById('income').value);
+ const cfa = parseFloat(document.getElementById('cfa').value);
+ const misc = document.getElementById('misc').value;
+
+ let resultText = '';
+
+ if (income > 100000 && cfa < 50) {
+ resultText = 'Consider completing more of your CFA before applying to law school.';
+ } else if (income < 50000 && cfa > 75) {
+ resultText = 'Now is a great time to apply for law school!';
+ } else {
+ resultText = 'Your optimal application time depends on balancing your income and CFA progress.';
+ }
+
+ if (misc.includes('savings') || misc.includes('commitments')) {
+ resultText += ' Ensure your financial and personal commitments are in order before applying.';
+ }
+
+ document.getElementById('resultText').textContent = resultText;
+ document.getElementById('result').classList.remove('hidden');
+ });