I want to extract the Text inside a Element with JQuery
<div id="bla">
<span><strong>bla bla bla</strong>I want this text</span>
</div>
I want only the text "I want this text" without the strong-tag. How can I do that?
I want to extract the Text inside a Element with JQuery
<div id="bla">
<span><strong>bla bla bla</strong>I want this text</span>
</div>
I want only the text "I want this text" without the strong-tag. How can I do that?
UPDATED:
UPDATED:
Tested in FF3, IE8, O10b on:
This does it (tested):
Try this...
This doesn't need to remove any other nodes from context, and will just give you the text node(s) on each iteration.
Variation on karim79's method:
or if you just want the root text without knowing what other tags are in it:
still a little long, but I think this about as short as you can hope for.