Skip to content Skip to sidebar Skip to footer

Jquery Grab Text From Div Minus Child Element

Is there an easy way to grab the text from this div with out getting any child elements?
Title Text Unwanted This is

Solution 1:

It basically boils down to this:

$("#someselector").clone().children().remove().end().text();

First, you clone the element, get its children, remove them and then get the text of the clone.

Post a Comment for "Jquery Grab Text From Div Minus Child Element"