Sorry...

To bring it all together, you could do:

$(this).children('.personal').text();

That will give you the text for the current divs child div.personal.

Adam




On Jun 17, 5:20 pm, Adam <[EMAIL PROTECTED]> wrote:
> Hey,
>
> 1. Let's say your div is #mydiv.
>
> Use
> $('#mydiv .personal').text()
> or
> $('#mydiv').children('.personal').text()
>
> 2. To get descendants use children(expr) or contents() 
> -http://docs.jquery.com/Traversing
>
> 3. To get current element use $(this) or to add to selection use
> andSelf() -http://docs.jquery.com/Traversing/andSelf
>
> Adam
>
> On Jun 17, 5:01 pm, mkn <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > Feel free to refer me to a FAQ if I've missed one.
>
> > Where 'a' is a jquery object representing a div element, I have
> >         a.("#" + a.attr('id') + " .personal").text()
> > in my code. I would expect that this would return only the text of the
> > descendant node with the class "personal," but I receive back the text
> > of the '#id' node. Am I doing something incorrectly?
>
> > Also, I've got that self-referential selector because I have been
> > unable
> > to find either 1) a jquery method that allows me to grab all the
> > descendants of a and then filter them, or 2) a selector that allows me
> > to refer to the current element. (Will a quoted "this" do that?)
>
> > Thanks

Reply via email to