How to get an element that was appended by before method?
<p>the source example is kind of this</p>

<pre><code>// block with caption
var caption_block = "&lt;div class='caption-block'&gt;&lt;h1&gt;"+ options.title + "&lt;/h1&gt;&lt;div class='pages'&gt;&lt;a href='/' id='left_pg'&gt;&lt;/a&gt;&lt;div id='counter'&gt;"+ (i+1)+'/'+(elms+1)+"&lt;/div&gt;&lt;a href='/' id='right_pg'&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;";

// put the elemnt with caption into the DOM
$('ul.slider').before(caption_block);

// by click in #counter TEST
$('a').bind('click',function(){

 $('#slider').find('#counter').text(" TEST ");

});
</code></pre>

<p>Unluck, but it's don't do anything at all.</p>

<p>The script can't find a <code>div#counter</code>. How to get it?</p>

<p>the html looks like</p>

<pre><code>&lt;div id="slider"&gt;&lt;ul class="slider" /&gt;&lt;/div&gt;
</code></pre>
