Contador de incremento cada vez que um elemento é clicado

// increment counter each time the picture element is clicked
        var counter = 0;//Counter variable starts at 0
        const var_counter = document.querySelector("#out_count");//display the number of clicks
        const elem = document.querySelector("body > div > div.box.kat_kontainer > img");//select the picture
        elem.addEventListener("click", function () {//function to be performed on each click
            counter += 1;//Counter variable is incremented by one
            var_counter.innerHTML = counter;//Display the value of the counter in the display element
        });
Meandering Meerkat