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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:23:36+00:00 2026-05-12T12:23:36+00:00

I have a table and I use jquery to get all the cells from

  • 0

I have a table and I use jquery to get all the cells from each row. Some of these cells have text and a image in them.

I want to grab the td cell(I have done this) then remove the image from these cells in memory(I don’t want to remove them from the actual table).

so my cell would look like this

<td>hi their <img...... /> </td> I grab this with jquery and I get the dom back now I don’t know how to remove the image tag.

so I want

var hold = // something to remove the img

alert(hold) produced:  "hi their".

Edit

here is what I have

<table id="tbl">
  <thead>
  <th> checkbox </th>
  <th>header 1 </th>
    <th>header 2 </th>
    </thead>
  <tfoot>
  </tfoot>
  <tbody>
    <tr>
      <td>checkbox </td>
      <td>hi there woot</td>
      <td>still no image </td>
    </tr>
    <tr>
      <td>checkbox </td>
      <td>a image is coming </td>
      <td> here is the image <img alt="" src="" class="imgClass" </td>
    </tr>
  </tbody>
</table>



var rowCells = $('#tbl :checked').parents('tr td');

var header2 = $(rowCells[2]).html() // grabs "still no image" and "here is the image <img ....."/>

so I tried like replace and stuff and nothihg as worked.

I want header2 variable to just have “here is the iamge”

  • 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-12T12:23:36+00:00Added an answer on May 12, 2026 at 12:23 pm

    Updated answers:

    var header2 = $(rowCells[2]).html().replace(/<img[^>]+>/g, '');
    var header2 = $(rowCells[2]).html().find('img').remove()
    

    Untested:

    var hold = $('td:first').html().replace(/<img[^>]+>/g, '');
    alert( hold );
    

    Alternative way using clones:

    var hold = $('td:first').clone().find('img').remove().end()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table, and when the user clicks on each cell, some details
So basically I use jQuery for alternating row colours by selecting all the tr
I have a table of data that I want to grab text from, stick
I have a iframe and want to either get some of the HTML from
I have a table of data that contains about 260 rows. Each of these
Currently we have a table that we use to track inivitations. We have an
While trying to use LINQ to SQL I encountered several problems. I have table
I have some elements that need to have the text inside editable, for this
I have a script that appends some rows to a table. One of the
If all tables I want to delete from have the column gamer_id can i

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.