So the function I am using here is simple (maybe not so much idk) all that is meant to happen is when an image is clicked on the page that has the class of .img it will open a modal to show a large view of the picture. simple right? well it works just fine in all browsers except IE (I hate IE already)
initially the code was built with an arrow function after googling I found that IE doesn't support arrow functions.. (why would it right?) so I simply changed the arrow function to just a function.. great works in other browsers... still not in IE.
img.forEach((img) => {
img.addEventListener('click', function mdl() {
modal.style.display = 'block';
modalImg.src = this.src;
})
})
img.forEach(function arrowFunction(img) {
img.addEventListener('click', function mdl() {
modal.style.display = 'block';
modalImg.src = this.src;
});
});