Hi folks, simple question I think.

Given this html:
<p id="foo">THIS IS THE TEXT I WANT<span class="bar> not this</span>
or this</p>

...how do you access the text 'THIS IS THE TEXT I WANT' through
jQuery?

In DOM-speak, it's this:
document.getElementById('foo').childNodes[0].nodeValue

This finds span.bar, as I expected, but not what I want:
jQuery('#zzz :first')

Problem is that I want the text of the first child node, not the first
child element.

Thanks,

Reply via email to