On Mar 8, 2:51 pm, Marc Liyanage <liyan...@gmail.com> wrote:
> I am wondering if this is a bug:
>
> <body id='body'>
>
>         <div id='foo' class='div_a'>
>                 <span class='span_a'></span>
>                 <div class='div_a'>
>                         <span class='span_a'></span>
>                         <div class='div_a'>
>                                 <span class='span_a'></span>
>                         </div>
>                 </div>
>         </div>
>
> </body>
>
> I would expect
>
> $('foo').select('div.div_a > span.span_a')
>
> to return three span elements because three of its span descendants
> match the selector. In fact it only returns two, the two deepest ones.

Hi Marc,

If I understand your code correctly, it reads as the following CSS
equivalent:

#foo div.div_a > span.span_a

which indeed matches only the last two elements, as you don't select
the first div element with class value 'div_a', because select()
matches all elements _from_ the element with id 'foo', but if you wrap
that element around your sets of 'div_a' elements, I expect your code
to work as expected.

Ta,
  Maarten

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to