document.addEventListener(‘DOMContentLoaded’, function () { let popupLinks = document.querySelectorAll(‘.jet-popup__inner a[href^=”#”]’); popupLinks.forEach(function (link) { link.addEventListener(‘click’, function (e) { let popupClose = link.closest(‘.jet-popup__container’).querySelector(‘.jet-popup__close, .jet-popup__close-button’); popupClose.click(); }); }); });