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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:12:00+00:00 2026-06-11T14:12:00+00:00

I need to remove three rows of a table when a link in the

  • 0

I need to remove three rows of a table when a link in the first row is clicked.

The rows are created dynamically using jQuery and pre-pended to the table as below.

var ups='';
        ups+='<tr data-file='+file_id+'>';
        ups+='<td width="40%">'+gl_file_name1+'</td><td>'+gl_upload_date1+'</td>';
        ups+='<td>'+gl_upload_desc+'</td>';
        ups+='<td><a href="sym.php?doc_id='+file_id+'" class="view2_fl">VIEW FILE</a> | <a href="javascript:void(0);" data-file='+file_id+' data-job='+job_id+' class="del2_fl">DELETE</a></td></tr>';
        ups+='<tr><td>'+priority+'</td><td>'+price+'</td><td>'+tender+'</td><td>&nbsp;</td></tr>';
        ups+='<tr class="bottom-row"><td colspan="4">'+notes+'</td><tr>';

        $(ups).prependTo('.app_table');

This is looped for as many times as there are ‘files’.

When the DELETE link is pressed I need to delete all three rows. So far I have managed to delete the first row using the code below:

$(this).closest("tr").remove();

I have tried to use .next() but this did not seem to work.

  • 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-11T14:12:01+00:00Added an answer on June 11, 2026 at 2:12 pm

    Get the row with the link, and from there you can get the next rows and add to the jQuery object, and remove all three in one go:

    var tr = $(this).closest("tr");
    tr.add(tr.next()).add(tr.next().next()).remove();
    

    By first getting all three rows you don’t have the problem that you want to find a row that is next to a row that you have already removed.

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

Sidebar

Related Questions

I have a very simple link table set up, I need to delete rows
I need to remove rows where there is a duplicate link column from a
I need to programmatically add and remove rows from a Word 2010 table. Unfortunately
I need solution of auto hide/remove table-rows of deleted records. Suppose a table-body element
I currently have a MySQL table of about 20 million rows, and I need
I'm trying to update a table to remove all but the first instance of
I need to be able to hide on default specific rows within a table.
I'm working on making a dynamic HTML table using jQuery. In a table, my
I have UITableViewController as the RootViewController. I need to add rows to the table
Rails 3.2.3 I need to insert many rows for a table by clicking a

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.