nathan111777,
//MODAL IMAGE PORTFOLIO
// Get the modal
var modal = document.getElementById('myModal');
var modalImg = document.getElementById("img01");
var captionText = document.getElementById("caption");
document.addEventListener('click', ({target}) => {
if(target.closest('.foto-portfolio')){
modal.style.display = "block";
modalImg.src = target.src;
captionText.innerHTML = target.alt;
}});
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}