I have a set of buttons with the same clickme
class:
<button class="clickme">Click Me 1</button>
<button class="clickme">Click Me 2</button>
<button class="clickme">Click Me 3</button>
I also have a click handler for the clickme
class:
$('.clickme').on('click', function () {
// do stuff
});
How can I keep track of click counts for each individual button in this scenario?
Note: I've provided my own answer below, but I'm not sure if mine is the best solution. I think I could improve the brevity.