Click outside modal

// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
	if (event.target == modal) {
		modal.style.display = "none";
	}
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *