Getting text within element excluding decendants

Viewed 1859

I see that jQuery has the .text() function for getting all text within an element and its descendant elements.

Is there a way to only get the text that is directly within the element?

eg.

<div>
Here is <b>some</b> text.
</div>

From that I would want to get just Here is text.

2 Answers
Related