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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:02:43+00:00 2026-06-16T22:02:43+00:00

I am trying to append a string, myoutput, right after a specific row in

  • 0

I am trying to append a string, myoutput, right after a specific row in a table similar to this one:

<table>
<tr data-my_id='1'> <td> content </td> </tr>
<tr data-my_id='2' data-my_other_id='1' > <td> content </td> </tr>
<tr data-my_id='3' data-my_other_id='2' > <td> content </td> </tr>
</table>

So let’s say I want to append my output string after the tr with data-my_other_id='2'
(note that in my code, my_other_id = 2 already )

I am trying to accomplish it doing this:

var want = $("tr").find("[data-my_other_id='" + my_other_id + "']").index();

after finding the index, I want to append my output strhing to this row…

$(want).insertAfter(...?);

Also… I noticed whenever I do

alert( want = $("tr").find("[data-my_other_id='" + my_other_id + "']").length)

I get 0 …

Help please and let me know if my question is not clear enough so I can explain better.

  • 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-16T22:02:44+00:00Added an answer on June 16, 2026 at 10:02 pm

    I’m assuming you want to update the content rather than append, but it doesn’t really change anything. I don’t think you want to use find() that way. Try something like:

    var $row = $('tr[data-my_other_id="' + id + '"]');
    // should be the index of the tr in the <table>
    // this may not be a good idea though - what if you add a header row later?
    var index = row.index() + 1; // if you want 1-based indices
    $row.find("td").text("I am row #" + index);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to append a string of svg elements to the dom. This is
I'm trying to append content from a file to a string. opening the file
I'm trying to append the following table built up in a string to a
Possible Duplicate: Read/convert an InputStream to a String I'm trying to append data from
After learning the basics from Apple's SimpleFTPSample project, I'm trying to append a string
I'm trying to append this string: &lt;div&gt; hello &lt;/div&gt; as an HTML node, but
I am trying to append table rows to an existing table. This is how
I'm trying to append a CSS class to a row on RowDataBound. I'm using
I am trying to append an image after the last input field in a
I am trying to append to a string in a for loop. I can

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.