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

  • Home
  • SEARCH
  • 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 9018139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:26:54+00:00 2026-06-16T04:26:54+00:00

i have a each loop like below $(‘#goldBarList tr:not(:eq(0))’).filter(‘:has(:checkbox:checked)’).each(function() { $(this).remove(); }); as i

  • 0

i have a each loop like below

$('#goldBarList tr:not(:eq(0))').filter(':has(:checkbox:checked)').each(function() {  
    $(this).remove();  
});

as i have 4000 rows and each row has a checkbox. I need to remove those rows having their checkbox checked.
However, the browser is giving stop running this script error?
because this loop is taking more time to finish.
so i just want to use setTimeout after 10 iterations and continue the loop after 0.5sec..
means i want the loop to sleep for 1/2sec after every 10 iterartions..
please give me some code reference…

Thanks…

  • 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-16T04:26:55+00:00Added an answer on June 16, 2026 at 4:26 am

    What it seems you’re really looking for is to be able to remove those elements without the browser timing out. Splitting the calls up using window.setTimeout does the trick, even if the timeout is 0. The code below does this in batches of 500.

    EDIT: Updated to improve performance. (Thanks Bergi.)

    var removeTds = function($el) {
        var elements = $el.filter(":lt(500)"),
            count = elements.length;
    
        elements.remove();
        $el = $el.filter(":gt(499)");
        if (count === 500) {
            window.setTimeout(function() {
                removeTds($el);
            }, 0);
        }
    };
    
    removeTds($('tbody tr:not(:eq(0))').filter(':has(:checkbox:checked)'));
    

    Here’s the fiddle.

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

Sidebar

Related Questions

I have a for each loop like this $sn_count = 1; $prodfilter = ;
I have loop and each iteration of Hash looks like this: [1, {:clid=>1, :nvz=>4,
I have a loop that can look like this: For Each article In artAll
I have a XML like this: <?xml version=1.0 encoding=UTF-8?> <nodes> <n c=value2/> <n>Has a
I have JS code something like shown below: function ValidateBid(source, args) { var txtValue
Here I have one file testdec.txt . In this File Contents are like below.
I have a loop that goes something like this, where arrayfunction sets all array
I have an .each loop in jQuery. I want to iterate the loop one
I have a For Each loop that is looping through an array of strings
i have a loop where a variable value will change in each loop and

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.