When I click a number goes up

I want to make it so when I click on an image a counter goes up. Anyone know how to do this?

Kind of like cookie clicker?

<img src="https://picsum.photos/200" onclick="updateValue()">
<script>
window.clickCounter = 0
function updateValue(){
window.clickCounter++
}
</script>

You can also us CountAPI to count across visitors (e.g. everyone that goes to the site sees the same count unless you add 1 more).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.