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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:24:23+00:00 2026-05-28T18:24:23+00:00

I have a html table: Name Length Description x Name1 444 Blabd x.png Name2

  • 0

I have a html table:

Name   Length Description  x
Name1  444    Blabd        x.png
Name2  55     Blabla       x.png
Name3  11     Blaaa        x.png

table id="firsttable" img class="delete"

I have a value (from other table):

var value = $(this).closest('tr').find('td:first').html();

I want to find that value in first column of a table and delete x.png of a row, which has that value.

Something like: (with mistakes)

$('#firsttable tr td:first:contents("'+value+'")').closest('tr').find('td:last').remove();
  • 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-28T18:24:24+00:00Added an answer on May 28, 2026 at 6:24 pm

    A few things:

    • use the :first-child selector and not :first.
    • you should use :contains and not :contents (i don’t think there is even a :contents() selector – or maybe via a plugin) (see note)
    • .siblings() will find the siblings of the current element which is the first TD. You can pass a selector to limit the selection so pass :last to get oly the last one. Makes more sense than going back to the parent and find the last TD.
    • you can empty the last TD content instead of removing the td element (but you can remove it if you want)

    Here’s the code:

    $('#firsttable td:first-child:contains("' + value + '")')
        .siblings(':last')
        .text('');
    

    DEMO

    Note:

    :contains will search in text nodes id the specified value is contained, not the exact value! So if you do :contains("1") but you have a TD with value “14”, it will find it also. If this is a problem you can use .filter():

    $('#firsttable td:first-child').filter(function() {
            return $(this).text() === value;
        })
        .siblings(':last')
        .text('');
    

    More info on:

    • :first and :first-child
    • :contains
    • .siblings()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a previous html code. <table width=600px cellspacing=0 border=1 id=mainTable> <tr> <th> Name
I have an html table <table border=0 width=100%> <tr class=headerbg> <th width=5%> No </th>
I have an html table which i bind data dynamically on the server side
I have an HTML table that looks like this: ------------------------------------------------- |Column 1 |Column 2
I have an HTML table with several columns and I need to implement a
I have a HTML table like this: <table border=1> <tbody> <tr> <td><a href=# class=delete>DELETE
I have a HTML table like this: <table border=1> <tbody> <tr> <td><a href=# class=delete>DELETE
I have an HTML table with one column being email addresses; spambot issues aside,
I have an HTML table with a large number of rows, and I need
I have an html table with many rows. I'm currently grouping several rows inside

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.