To get just the text nodes:
$('div').contents().filter(function(){return this.nodeType==3;});

If you want to filter out 'empty' nodes:
$('div').contents().filter(function(){return this.nodeType==3 &&
this.nodeValue.replace(/\W/g,'')!='';});

Take it from there :)

On May 1, 4:06 pm, nick <nboutel...@gmail.com> wrote:
> How would I select "Free sex" out of...
>
> <div>
>    Free sex
>    <ul>
>       <li>Symphilis</li>
>       <li>Ghonoreah</li>
>       <li>Aids</li>
>    </ul>
> </div>

Reply via email to