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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:52:18+00:00 2026-05-15T13:52:18+00:00

I have the following dynamically generated table on a page along with other tables

  • 0

I have the following dynamically generated table on a page along with other tables on the page. I need to remove this table which does not have an id.There is one of two ways that I can think of to target the table for removal since these never change.

By the class=”matching_results_text” or
by the text “You are here”

Just do not know how to do it.

I tried $(“table”).remove(“:contains(‘You are here:’)”); but that didn’t work right.

<table width="100%" border="0" cellspacing="0" cellpadding="5">
          <tr> 
            <td>        
                <b>You are here: <a href="http://www.test.com">Home</a> &gt; <a href="http://www.test.com/Ignition-Controls-s/30.htm" title="Ignition Controls">Ignition Controls</a></b>
<div class="matching_results_text">We found 10 results matching your criteria.</div>

 </td>
          </tr>
        </table>
  • 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-15T13:52:19+00:00Added an answer on May 15, 2026 at 1:52 pm

    EDIT: Note, that if there is more than one element with div.matching_results_text or a[title=Ignition Controls], it will not work, as you will match all of those elements.

    If that is the case, try the last solution I gave, or post more of your HTML structure. There may be ancestor elements that will help.


    jQuery’s .closest() method returns one result containing the closest ancestor matching the selector.

        // Starting point is the class name
    $('table div.matching_results_text').closest('table').remove();
    

    or

        // Starting point is the <a> element with the title Ignition Controls
    $('table a[title=Ignition Controls]').closest('table').remove();
    

    Just for fun, I’ll throw one more option out there that uses :contains() and .closest().

        // Starting point is the <b> element that contains "You are here"
    $('table b:contains(You are here)').closest('table').remove();
    

    http://api.jquery.com/closest/

    If you know that it is (for example) the 3rd table on the page, you could use the index reference.

         // Get the third table on the page
    $('table:eq(2)').remove();
    

    http://api.jquery.com/eq-selector/

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

Sidebar

Related Questions

I have following situation. A main table and many other tables linked together with
I have a table of data which is generated dynamically with Javascript. Every few
I have a page in which one chooses from a selection of dynamically generated
I have a link that I dynamically create which looks something like the following:
I have an ASP.NET page with 10 dynamically generated LinkButton elements. When a user
I have the following code generated dynamically. It can be just one, two, three
I have the following dynamically generated array: var myArray = (0% { left:74px; top:202px;
I have the following dynamically generated strings: var stringA = [a1, a2, a3 ...
I have a page with 80+ dynamically generated input boxes, when the user submits
Imagine I have the following 'partial' which is generated through a bunch of views:

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.