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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:03:47+00:00 2026-05-13T21:03:47+00:00

I have below is the html code for TD which gets appended after matching

  • 0

I have below is the html code for TD which gets appended after matching the IDs from below LI HTML code

<td style="border-top-style: solid; border-right-style: solid; border-left-style: solid;
    border-bottom-style: solid" id="Communication">
    Communication Science Course
</td>

<li id="CommunicationTooltip"><a href="#" target="_blank" class="toolTip">
    <img src="/images/q_mark.gif" alt="" /><span style="width: 300px; padding: 10px 10px 10px 55px;">Testing
    Communication.</span></a> 
</li>

<td style="border-top-style: solid; border-right-style: solid; border-left-style: solid;
    border-bottom-style: solid" id="Communication_1">
    Communication Science Course II
</td>

<li id="Communication_1Tooltip"><a href="#" target="_blank" class="toolTip">
    <img src="/images/q_mark.gif" alt="" /><span style="width: 300px; padding: 10px 10px 10px 55px;">Testing
    Communication II.</span></a> 
</li>

Here is Jquery which matches the relative IDs and takes tag from above LI and further append in above TD

$(document).ready(function() 
{

        // bind to cells with an ID attribute
        $("table > tbody > tr > td[id]").each(function() 
        {                

            // grab the anchor from the LI whose ID starts with the cell's ID
            var $tooltip = $("div:hidden li[id^=" + $(this).attr("id") + "] a");

            //alert($tooltip);

            // append it to the current cell
            $(this).append($tooltip);

        });
});

if you see the above HTML code we have two different LI IDs (Communication and Communication_1),The issue is that it works fine if I use Communication1 as second ID, however when I use Communication_1 it appends the ANCHOR tag to Communication TD, if you check above Jquery it matches the LI IDs starting with same ID, However I want it that it should match perfect LI ID not starting with same ID.

Please amend the above Jquery code.

Thanks

  • 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-13T21:03:47+00:00Added an answer on May 13, 2026 at 9:03 pm

    I am not 100% sure of what you want to achieve, I can only guess the issue is you are using ‘startwith’ to match the IDs. Since the toolip ID is always “idOfTDTooltip”, why not match them exactly?

    var $tooltip = $("div:hidden li[id='" + $(this).attr("id") + "ToolTip'] a");
    

    Alternatively, case-insensitive comparing of the ID with ID+’tooltip’:

    $(document).ready(function() {
        // bind to cells with an ID attribute
        $("table > tbody > tr > td[id]").each(function() 
        {                
            appendTooltip($(this), $(this).attr('id'));
        });
    });
    
    function appendTooltip(obj, theId) //find and append tooltip
    {
      $("div:hidden li[id^='" + theId + "'] a").each(function(){
        if($(this).parent().attr('id').toLowerCase() === (theId + "tooltip").toLowerCase()) {
          obj.append($(this));
          return;
        }
      });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 336k
  • Answers 336k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer No it doesn't support RTP as standard you will have… May 14, 2026 at 3:53 am
  • Editorial Team
    Editorial Team added an answer Actually, you can just "Add Web Reference". Give the path… May 14, 2026 at 3:53 am
  • Editorial Team
    Editorial Team added an answer I'm not sure how to do this using Query syntax… May 14, 2026 at 3:53 am

Related Questions

I have a variable with hyper links (www.wow.com) like this. I have to pass
Thanks for the three excellent answers which all identified my problem of using "onclick
The issue I have a <div> on a page which is initially hidden with
I'm using Sharepoint (WSS 3.0), which is unfortunately very limited in its ability to
I want to get the business hours from ScotiaBank branches that are near to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.