I have divs on a form:
<div id="foo">
<div>koko</div>
<div>lala</div>
Plain text here
<div>Another div</div>
</div>
I want to use jquery in order to keep “Plain text here” but not show any other internal element in the others divs.
I tried using the .not like this:
alert($("#foo).not("div").text());
But it doesn’t display anything.
Try this:
http://jsfiddle.net/LtMHE/