how to grab a text from a certain div with jquery
<p>Hello everyone and thanks in advance for reading this..
I have the following html code</p>

<pre><code>&lt;div id="ImagePagination" class="Pagination"&gt; 
    Photo 
    &lt;span id="currentPhotoCount"&gt;&lt;#currentPhotoCount#&gt;
    &lt;/span&gt; of
    &lt;span id="maxPhotoCount"&gt;&lt;#maxPhotoCount#&gt;
    &lt;/span&gt;
&lt;/div&gt;​
</code></pre>

<p>The currentPhotoCount and maxPhotoCount variables are set from a jquery image slider script that works perfectly but i want to grab the text of the currentPhotoCount  so as to use it in an another script. Any suggestions of how i can achieve that will be highly appreciated!!!
I have tried this piece of code..am i doing something wrong?</p>

<pre><code>  var pic=parseInt($('#currentPhotoCount').text(), 10);
  x = '../object_images/medium/&lt;#OBJECT_ID#&gt;_"'+pic+'".jpg';
  $(".gallery a[rel^='prettyPhoto']").attr({src:x}); 
</code></pre>

<p>After hitting my head against the wall for several hours i realized that it was a quotes issue..I deleted the double quotes from the x variable so...</p>

<pre><code>      x = '../object_images/medium/&lt;#OBJECT_ID#&gt;_"'+pic+'".jpg';
</code></pre>

<p>becomes</p>

<pre><code>      x = '../object_images/medium/&lt;#OBJECT_ID#&gt;_'+pic+'.jpg';
</code></pre>

<p>And everything works as it should now...Thank you all very much for helping me!!</p>
