Declare a global var:
var clicks
And on each button click add a
clicks+1
that way you’ll know the number of clicks