diff --git a/Labs/week7/week7.html b/Labs/week7/week7.html index c32d022c..449bb958 100644 --- a/Labs/week7/week7.html +++ b/Labs/week7/week7.html @@ -349,9 +349,9 @@

Drei Hirtenkinder aus Fátima by Johannes Stecher

modalImg.src = this.src; captionText.innerHTML = this.alt; } - for (var i = 0; i < img.length; i++) { - img[i].addEventListener('click', showModal); -} + +// Get the element that closes the modal +var span = document.getElementsByClassName("close")[0]; // When the user clicks on (x), close the modal span.onclick = function() { @@ -359,6 +359,7 @@

Drei Hirtenkinder aus Fátima by Johannes Stecher

} +