mirror of
https://github.com/Alvin-Zilverstand/challenge-11.git
synced 2026-03-06 11:06:21 +01:00
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.
This commit is contained in:
@@ -19,9 +19,9 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Get Started button functionality
|
// Get Started button functionality
|
||||||
const getStartedBtn = document.querySelector('.btn-primary');
|
const getStartedButtons = document.querySelectorAll('.btn-primary');
|
||||||
if (getStartedBtn) {
|
getStartedButtons.forEach(button => {
|
||||||
getStartedBtn.addEventListener('click', () => {
|
button.addEventListener('click', () => {
|
||||||
// Create and show modal
|
// Create and show modal
|
||||||
const modal = document.createElement('div');
|
const modal = document.createElement('div');
|
||||||
modal.className = 'fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 fade-in';
|
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
|
// Form submission handling
|
||||||
const contactForm = document.querySelector('form');
|
const contactForm = document.querySelector('form');
|
||||||
|
|||||||
Reference in New Issue
Block a user