function check(){ var currentCount = 1; return function() { currentCount++; if currentCount=11 {$('#set_filter').click(); } } }