document.addEventListener("DOMContentLoaded", function () {
var btn = document.querySelector("#menu-item-296"); // Your button with ID menu-item-296
if (btn) {
btn.addEventListener("click", function (e) {
e.preventDefault(); // Prevents the default button click action (if any)
console.log("Mailchimp popup triggered"); // For debugging
window.dispatchEvent(new Event("MailchimpPopupOpened")); // Trigger the Mailchimp popup
});
} else {
console.log("Button not found!"); // Debugging if the button ID is incorrect
}
});