diff --git a/js/cert.js b/js/cert.js index 126d265..4220e9c 100644 --- a/js/cert.js +++ b/js/cert.js @@ -8,7 +8,12 @@ function myModalShowImg(picture) { } // When the user clicks on (x) or the picture, close the modal -var span = document.getElementsByClassName("close")[0] && document.getElementsByClassName("modal-content")[0]; +var span = document.getElementsByClassName("close")[0]; span.onclick = function () { modal.style.display = "none"; +}; + +var picture = document.getElementsByClassName("modal-content")[0]; +picture.onclick = function () { + modal.style.display = "none"; }; \ No newline at end of file