var buttonNo = document.getElementById('existing-no'); var buttonYes = document.getElementById('existing-yes'); var text = document.getElementById('existing-text'); var buttons = document.getElementById('existing-buttons'); document.addEventListener('DOMContentLoaded', function() { if (buttonNo) { buttonNo.addEventListener('click', function() { window.open("https://anabaccreditationapplication.ansi.org", "_self"); }); } if (buttonYes) { buttonYes.addEventListener('click', function() { //alert('Button 2 is clicked'); buttons.style.display = 'none'; text.style.display = 'block'; }); } }); document.addEventListener('click', function(event) { // Check if the clicked element has the class 'kt-modal-close' if (event.target.classList.contains('kt-modal-close')) { buttons.style.display = 'flex'; text.style.display = 'none'; } }); document.addEventListener('submit', function (e) { // Check if the submitted form has the target class if (e.target && e.target.classList.contains('no-jetpack')) { e.stopImmediatePropagation(); // Prevent Jetpack’s handler from firing // Do NOT call e.preventDefault() so the form still submits normally } }, true); // capture phase