> $('form.formclass').find('li/label').each(....

That means "all LABEL tags that are a direct descendant of a LI tag that is
a child of a FORM tag with the class 'formclass'."

$('form.formclass').find('li label').each(....


"All LABEL tags that are a child of an LI tag that is a child of a FORM tag
with the class 'formclass'."

The former will match:

<form class="formclass"><fieldset><ul><li><label for="...">...

But not:

<form class="formclass"><fieldset><ul><li><div><label for="...">...

Since the LABEL is no longer a direct descendant of the LI. The "li label"
version would match either.

Note that find() is working about the same as the space, so you could write:

$('form.formclass li label') or $('form.formclass li/label')

Also note that as of 1.2, I think li/label doesn't work at all anymore
without the XPath plugin. The preferred syntax is now "li > label" instead
of "li/label". The preferred syntax will also work with older versions.

--Erik

Reply via email to