Answer the question
In order to leave comments, you need to log in
How to make one counter for different elements?
Hello! I have two blocks and there is one counter for them, but how can I make the counter count only for clicks of one element and start counting from 0 when clicking on another? I understand that you can add several counters, but as for me, this is not the best option, setting 40 variables is somehow not right.
This is what the example looks like now:
jsfiddle.net/pnq2qtfj/1
I hope I explained it clearly.
Answer the question
In order to leave comments, you need to log in
jsfiddle.net/pnq2qtfj/7
or
jsfiddle.net/pnq2qtfj/10
or
jsfiddle.net/pnq2qtfj/11
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question