diff --git a/assets/js/script.js b/assets/js/script.js index e565ca6..1aca866 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -60,4 +60,22 @@ const headerActive = function () { } } -addEventOnElem(window, "scroll", headerActive); \ No newline at end of file +addEventOnElem(window, "scroll", headerActive); + +document.getElementById('newsletterForm').addEventListener('submit', function (event) { + event.preventDefault(); // Prevent the default form submission + + // Simulate form processing (e.g., sending data to a server) + setTimeout(function () { + // Clear the input field + document.querySelector('.email-field').value = ''; + + // Show the success message + document.getElementById('successMessage').style.display = 'block'; + + // Hide the success message after 5 seconds + setTimeout(function () { + document.getElementById('successMessage').style.display = 'none'; + }, 5000); // 5000 milliseconds = 5 seconds + }, 500); // Simulate a slight delay for processing +}); \ No newline at end of file diff --git a/index.html b/index.html index 8dd77e9..60fe827 100644 --- a/index.html +++ b/index.html @@ -551,16 +551,17 @@

Subscribe newslater get latest updates and deals

-
- - + +
- + +