Changed around line 1
+ document.getElementById('personalityQuiz').addEventListener('submit', function (e) {
+ e.preventDefault();
+
+ // Calculate the result based on the quiz answers
+ const q1 = parseInt(document.getElementById('q1').value);
+ // Add more questions here
+
+ // Example logic to determine the career match
+ let careerMatch = '';
+ if (q1 >= 4) {
+ careerMatch = 'Team Manager';
+ } else {
+ careerMatch = 'Independent Consultant';
+ }
+
+ // Display the result
+ document.getElementById('careerResult').textContent = careerMatch;
+ document.getElementById('quiz').classList.add('hidden');
+ document.getElementById('result').classList.remove('hidden');
+ });
+
+ document.getElementById('retakeQuiz').addEventListener('click', function () {
+ document.getElementById('quiz').classList.remove('hidden');
+ document.getElementById('result').classList.add('hidden');
+ document.getElementById('personalityQuiz').reset();
+ });