From 1bb83ea38a95d2d7d13fcee8327fa7c1dfa06a4c Mon Sep 17 00:00:00 2001 From: SrijaVuppala295 Date: Sun, 10 Nov 2024 17:00:11 +0530 Subject: [PATCH] done --- popup.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/popup.js b/popup.js index 7a60376ef..7cc9f2ad8 100644 --- a/popup.js +++ b/popup.js @@ -20,15 +20,20 @@ window.onload = function() { // Handle form submission - document.getElementById('emailForm-nl').addEventListener('submit', function(event) { - event.preventDefault(); + document.getElementById("emailForm-nl").addEventListener("submit", function (event) { + event.preventDefault(); // Prevent form from actually submitting or refreshing the page + + const emailInput = document.getElementById("email-nl"); + + // Here you can add code to handle the subscription, e.g., send data to your server + + // Clear the input field + emailInput.value = ""; + + // Optionally, you can display a confirmation message + alert("Thank you for subscribing!"); +}); - const email = document.getElementById('email-nl').value; - if (email) { - alert(`Your email ID ${email} has been registered successfully for the newsletter.`); - document.getElementById('popup').style.display = 'none'; - } - }); // Handle "No thanks" link