For example, given the following HTML:
<a id="test" href="#">Text of A <span>(span text)</span></a>
Then jQuery('#test').text() will return 'Text of A (span text)', is there a way to get just 'Text of A ' (the text inside the <a> tag and not in it’s descendant <span> tag)?
Here is a link to a conversation that solves your problem:
select top level nodetext is not supported with jQuery?
Here is an excerpt: