How to change the x value each time a new user clicks on the button?

You want each new user clicks on the button, the value "x" increment by 1, and after the "x" will be equal to 5 is reset to 0. Is there a way to implement this using jquery?
June 10th 19 at 14:36
2 answers
June 10th 19 at 14:38
Solution
Clicked and: if instead of 5 generates a random number to 50 for example and make a game - try to score the maximum. And a separate button to throw in the total current achievement))) - Leda15 commented on June 10th 19 at 14:41
Thanks, works) - nikita.Stracke commented on June 10th 19 at 14:44
June 10th 19 at 14:40
if(x<5) x++; 
else x = 0;

So chtoli?)))
And thank You ;) - Leda15 commented on June 10th 19 at 14:43
that NC) - nikita.Stracke commented on June 10th 19 at 14:46

Find more questions by tags jQuery