On Aug 2, 2007, at 4:50 PM, Stephan Beal wrote

That limits the searches to under the given content. (Though i'm not
100% certain whether you need the $() around 'this' or not.)

No, it isn't necessary. So, this would work:

        $('span', this)

as would this:

        $(this).find('span')

or, if you really want just children (and not other descendants), you could do this:

        $(this).children('span')

Of course, since you already have done var l = $(this), you could do l.children('span') instead.

And so on.

--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



:


On Aug 2, 10:17 pm, cfdvlpr <[EMAIL PROTECTED]> wrote:
However, I'd like to also get access to the attributes of a span
within that li.  What line of code would give me a variable with that
span's attributes?

You can use the $('selector') syntax, simply pass on a context
argument as the second argument:

var s = $(selector,$(this))

That limits the searches to under the given content. (Though i'm not
100% certain whether you need the $() around 'this' or not.)


Reply via email to