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 7916433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:48:25+00:00 2026-06-03T14:48:25+00:00

I have an array of jQuery objects. I’d like to interact with each item

  • 0

I have an array of jQuery objects. I’d like to interact with each item in the array if they are visible. My flow goes something like this:

  1. Create an array, whose elements are all jQuery objects.
  2. The objects may or may not be visible.
  3. Start with the first element in the array.
  4. Wait for the item to be visible, time is arbitrary. Say 3 seconds. If becomes visible, go to step 5, else return from ‘play’ function. // Updated
  5. Click the item.
  6. Repeat 4-5 until there are no more items left to be interacted with.

UPDATE (clarification of use case):
Essentially what I’m doing is performing a series of serial actions on an array. A-B-C-D, in order. However there may be an issue when A creates B’s element and B has already been checked if it was visible. It won’t get clicked on.

I’ve been looking at jQuery’s deferred object, but am at a loss on how to implement it. How can this be implemented? Is there an alternative to using a deferred object?

As per @jmort’s suggestion I’ll attach what I have so far.

var play = function() {
    var dfds = []; 
    $(steps).each(function(i, v) {
        dfds[i] = $.Deferred();
    }); 

    $.when.apply(null, dfds).then(function(){
        console.log('all done');
    }); 

};  

Assume that steps equals the array of jQuery objects.

  • 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-06-03T14:48:27+00:00Added an answer on June 3, 2026 at 2:48 pm

    It can be done easily:

    var play = function() {
        $(steps).filter(':visible').click();
    }; 
    

    Update:

    var play = function() {
        $(steps).each(function() {
            $(this).filter(':visible').click();
        });
    };​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working in jQuery or plain javascript If i have an array of objects like
I have a general (custom) jQuery plugin. $.fn.something(). This gets called on some objects
I have array like this: $path = array ( [0] => site\projects\terrace_and_balcony\mexico.jpg [1] =>
I have array result like this: Array ( [0] => stdClass Object ( [id_global_info]
I have an array of objects. Each object has, among others, an ID attribute.
I have two arrays of objects. I would like iterate over each of these
I have a bunch of JSON objects stored in an array in JQuery. Is
Considering I have an array of objects, and all objects represent something out of
I have an array of objects in array notation. This array is going to
I have an array of javascript objects like the following: var food = [

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.