Grabing the anchor from the LI whose ID is same as the cell's ID
<p>I have below is the html code for TD which gets appended after matching the IDs from below LI HTML code</p>

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

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

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

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

<p>Here is Jquery which matches the relative <strong>IDs</strong> and takes tag from above <strong>LI</strong> and further append in above <strong>TD</strong></p>

<pre><code>$(document).ready(function() 
{

        // bind to cells with an ID attribute
        $("table &gt; tbody &gt; tr &gt; 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);

        });
});
</code></pre>

<p>if you see the above HTML code we have two different LI IDs <strong>(Communication and Communication_1)</strong>,The issue is that it works fine if I use <strong>Communication1</strong> as second <strong>ID</strong>, however when I use <strong>Communication_1</strong> it appends the ANCHOR tag to <strong>Communication</strong> 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.</p>

<p>Please amend the above Jquery code.</p>

<p>Thanks</p>
