jQuery nested span text value
<pre><code>&lt;div id="divBase0" class="divBase"&gt;
&lt;span id="p0" class="displayText"&gt;text line 1&lt;/span&gt;
&lt;span id="l0" class="displayText"&gt;text line 2&lt;/span&gt;
&lt;span id="f0" class="displayText"&gt;text line 3&lt;/span&gt;
&lt;span id="d0" class="displayText"&gt;text line 4&lt;/span&gt;
&lt;span id="t0" class="displayText"&gt;text line 5&lt;/span&gt;
&lt;/div&gt;
</code></pre>

<p>I have the above div and spans in my page.  In the following code I am able to get the id of p0 (alert(pID).  However I really want to get the text inside the span of p0.</p>

<pre><code>$("div[id^='divBase']").live("click", function () {
    var pID = $(this).find("span[id^='p']").attr("id");
    alert(pID);
});
</code></pre>

<p>I should note that I'm generating the divs and the spans (writing them out in jQuery) when the form loads.  So that is why I have the .live.    Am I doing it the best way to find the nested span(s) in the divBase0?  And secondly how can I get the text in span p0?</p>

<p>Thanks!</p>
