Elementor popup events today support just jQuery. If you need a Vanilla Js solution check this: https://eduardovillao.me/handle-elementor-popup-events-without-jquery/
// Select the <body> element
const body = document.body;
// Create a MutationObserver
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
// Check if new nodes were added
if (mutation.type === "childList") {
mutation.addedNodes.forEach((node) => {
// Check if the added node is an Elementor popup modal
if (node.classList && node.classList.contains("elementor-popup-modal")) {
console.log("Elementor popup detected:", node);
// Add your custom logic here
}
});
}
});
});
// Configure the observer to monitor the <body>
observer.observe(body, { childList: true });
// Stop observing when no longer needed (optional)
// observer.disconnect();