4
I would like to know how to, when clicking on ANY image on the page, activate a function.
I tried it in the following ways: 1-
var imagez = document.getElementsByTagName('img');
imagez.onclick = () =>{
console.log(images);
}
2-
const images = document.querySelectorAll('.janela');
//nesse caso, todas as imagens da tela teriam a classe "janela"
images.onclick = () =>{
console.log(images);
}