I currently have the following
<div class ="parent">
<div class="inner">Hello
<div>Goodbye</div>
</div>
</div>
<div class ="parent">
<div class="inner">Hello
<div>Goodbye</div>
</div>
</div>
I am currently using $(div.parent).each(function(index,item) to iterate through each parent which works perfectly.
My problem is that I need to select the word hello. I am currently using $(item).text() but it is always returning HelloGoodBye which is a problem. I need to ignore any other div.
Any help appreciated thanks.
Try
Alternately
http://api.jquery.com/not/