I've made a script which calls a function every 5 clicks on an element. What I'd like to do now is to repeat the action every 5 clicks, and not just call it only once. Is there any way to reset the variable count when the action is called?
$(document).ready(function(){
var count=0;
$(".logo").click(function(){
count+=1;
if (count==5) {
$( "body" ).toggleClass('easteregg');
}
});
});