getting the direct content of an html element encapsulated in a jquery object

Posted by codergeek on Stack Overflow See other posts from Stack Overflow or by codergeek
Published on 2010-04-13T03:16:19Z Indexed on 2010/04/13 3:23 UTC
Read the original article Hit count: 227

Filed under:

I have an piece of html in a jquery object. When I say $(this).html() I get:

<span class="value">4</span><span class="type">teaspoons</span>butter

I want to get only the piece of text from this html segment that is not in the spans. in this example, it is butter.

How do I get that?

Thanks!

© Stack Overflow or respective owner

Related posts about jQuery