jQuery(function($){ // Get the modal var modal = document.getElementById("pmdModal"); // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } }); // Open the modal function openPopup(){ let modal = document.getElementById("pmdModal"); modal.style.display = "block"; } // Open the modal function closePopup(){ let modal = document.getElementById("pmdModal"); modal.style.display = "none"; }