Targeting the correct element with jQuery
<p>A tooltip library is copying the dom node to insert the html inside a tooltip. </p>

<p><strong>I need to target the element inside the tooltip, but the javascript is always applied to the original element.</strong></p>

<pre><code> &lt;a class="tooltip"&gt;Open&lt;/a&gt;

&lt;div class="tooltip-html" style="display:none;"&gt;
&lt;div id="main-content" class="scroll"&gt;
    &lt;div class="Content"&gt;
        &lt;div class="blue"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p></p>

<p>I have tried using the enter callback of the tooltip, this was not working. And applying things before the html is copied by the tooltip only cosmetically works, the javascript is still looking at the original. I even tried changing the class before I apply anymore javascript. Figuring if I changed the class the original element would no longer be accessible. The class changed, but the javascript was not applied to what was inside the tooltip.</p>

<p>Is there a good way remove a div once it has been copied, or a better method of finding/targeting the correct element.</p>

<pre><code>$(this).find("div.scroll").test();
</code></pre>

<p>EDIT:</p>

<pre><code>...Before...
    &lt;div id="main-content" class="scroll"&gt;
    &lt;div class="Content"&gt; 

...After...

&lt;div id="tiptip_holder" style="max-width: 230px; margin: 23px 0pt 0pt 999px; display: none;" class="tip_left_bottom"&gt;
&lt;div id="tiptip_arrow" style="margin-left: 220px; margin-top: -12px;"&gt;
&lt;div id="tiptip_content"&gt;
    &lt;div id="main-content" class="scroll"&gt;
    &lt;div class="Content"&gt; 
    ....
</code></pre>

<p>The <strong>this</strong> was a part of the enter callback for the tooltip library:</p>

<pre><code> var tip_html = $('.tooltip-html').html();
    $('.tooltip').tipTip({ content: tip_html, enter: function(){
        $(this).find("div.scroll").test();

    }
</code></pre>

<p>Also tried using, </p>

<pre><code>$("#main-content.scroll", "#tiptip_content").test();
</code></pre>

<p><strong>UPDATE:</strong></p>

<p>As people mentioned naming the parent div like I was should of worked, here's an example of how i'm not able to target inside the tooltip.</p>

<p><a href="http://jsfiddle.net/mstefanko/pUm5V/24" rel="nofollow">jsfiddle.net/mstefanko/pUm5V/24</a></p>

<pre><code>//$("#main-content", "#tooltip-content").css("background", "red");
$("#main-content", "#tiptip_content").css("background", "blue");
</code></pre>

<p>Blue doesn't work, red does. I feel like both lines should work.</p>
