Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ const startBtn = document.getElementById('startBtn');
+ const assessmentSection = document.querySelector('.assessment');
+ const resultsSection = document.querySelector('.results');
+ const careerForm = document.getElementById('careerForm');
+ const resultsContainer = document.getElementById('resultsContainer');
+ const retakeBtn = document.getElementById('retakeBtn');
+
+ const careerData = {
+ tech: ['Software Developer', 'Data Scientist', 'Cybersecurity Analyst'],
+ creative: ['Graphic Designer', 'Writer', 'Film Director'],
+ business: ['Entrepreneur', 'Marketing Manager', 'Financial Analyst'],
+ science: ['Biomedical Researcher', 'Environmental Scientist', 'Physicist'],
+ helping: ['Teacher', 'Social Worker', 'Nurse']
+ };
+
+ startBtn.addEventListener('click', () => {
+ document.querySelector('.intro').classList.add('hidden');
+ assessmentSection.classList.remove('hidden');
+ });
+
+ careerForm.addEventListener('submit', function(e) {
+ e.preventDefault();
+ const interests = this.querySelector('select').value;
+ showResults(interests);
+ });
+
+ retakeBtn.addEventListener('click', () => {
+ resultsSection.classList.add('hidden');
+ assessmentSection.classList.remove('hidden');
+ });
+
+ function showResults(interest) {
+ const careers = careerData[interest];
+ resultsContainer.innerHTML = `
+
Based on your responses, consider these careers:
+ ${careers.map(career => `
${career}`).join('')}+
+
Remember, these are just suggestions. Explore more about each career to find your perfect match!
+ `;
+ assessmentSection.classList.add('hidden');
+ resultsSection.classList.remove('hidden');
+ }
+ });