Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7277855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:47:50+00:00 2026-05-28T22:47:50+00:00

I having some trouble figuring this problem out where I have one button which

  • 0

I having some trouble figuring this problem out where I have one button which does a mass clicking of other buttons on a page. Though the issue is I don’t want to activate all the buttons all at once and basically time them out until the other buttons finish their actions.

Page.MassCheckStats = function(){
        $('[data-field="button_update_stats"]').each(function(){
            $(this).click();
        });
    }

How can I get the above code to click 3 buttons at a time before going on to the other buttons.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T22:47:51+00:00Added an answer on May 28, 2026 at 10:47 pm

    You can use recursive timeouts like this:

    (sorry, i forgot it was three buttons at a time);

    Page.MassCheckStats = function(button){
        var button = typeof button == 'undefined'?$('[data-field="button_update_stats"]')[0] : button;
        for(var i = 0; i < 3; i++){
           $(button).click();
           if($(button).next().length == 0) return;
           button = $(button).next();
        }
        setTimeout(function(){             
           Page.MassCheckStats($(button));
        }, 1000);
    }
    

    where 1000 = 1000 miliseconds = 1 second

    and here’s the fiddle for it:
    http://jsfiddle.net/andrepadez/cR4tP/2/

    the firs line inside the function is a trenary operator. it means that if you do not pass any parameter calling the function (the first time it is called), typeof button == 'undefined', so it will assign to var button the first element selected by the jQuery selector – $('[data-field="button_update_stats"]')[0]. When i call it again from the timeouts, i am passing the current $(button).next() so it will assume what was passed in the parameter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble figuring this out. I have an unordered list menu that
I'm having some trouble figuring out to call methods that I have in other
I'm having some trouble figuring out the right selector syntax for this problem and
I'm having some trouble figuring this out. I have the following CSV string hello
I am having trouble figuring out one implementation problem, I have one class, it
I'm having some trouble figuring this out. I have a script that checks a
I'm having some conceptual trouble on figuring out how to best implement this... I
I'm having some trouble figuring out the best/Djangoic way to do this. I'm creating
I'm having some trouble figuring this out. I want to make it so I
I'm having some trouble figuring out the best way to do this, and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.