From f734a41678e6966e961875cf2a4a89646873e2a0 Mon Sep 17 00:00:00 2001 From: Alvin <524715@vistacollege.nl> Date: Wed, 4 Jun 2025 11:13:48 +0200 Subject: [PATCH] Refactor 'Get Started' button functionality in script.js to support multiple buttons. Update event listener to handle all instances of the button, enhancing user interaction with modal display. --- js/script.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/script.js b/js/script.js index c749334..ca8cd1e 100644 --- a/js/script.js +++ b/js/script.js @@ -19,9 +19,9 @@ document.addEventListener('DOMContentLoaded', () => { }); // Get Started button functionality - const getStartedBtn = document.querySelector('.btn-primary'); - if (getStartedBtn) { - getStartedBtn.addEventListener('click', () => { + const getStartedButtons = document.querySelectorAll('.btn-primary'); + getStartedButtons.forEach(button => { + button.addEventListener('click', () => { // Create and show modal const modal = document.createElement('div'); modal.className = 'fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 fade-in'; @@ -76,7 +76,7 @@ document.addEventListener('DOMContentLoaded', () => { }); }); }); - } + }); // Form submission handling const contactForm = document.querySelector('form');