Thanks for the comment. In my example I only have one-level nesting,
so I guess both statements were identical, but I've actually had to
change it using .children(':first') to make it work:<ul class="myClass"> <li>text</li> <li>text</li> </ul> I wish I could get a printout of the dom tab in firebug so I could compare it with 1.2.6 (I'd also like to come up with a simple test case, but I haven't found a way to replicate it). On Jan 13, 3:08 pm, John Resig <[email protected]> wrote: > > $('.myClass').find(':first-child') > > use this instead: > > $('.myClass').children(':first') > > The difference between these two selectors is that the first will > match all *descendant* elements which are the first child of their > parent. That could be quite a few elements. > > Whereas the second one will only match the first direct child element > of the parent - this will only ever be zero or one element. > > --John --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---
