Hum, indeed, didn't think of that...!
But
element.immediateDescendants().grep(new Selector("#some .selector"));
is kinda ugly, huh?
Prototype guys should put a little sugar on this matter =)
Nicolás Sanguinetti escreveu:
> That works fine with $$, but if you have an element already there and
> want to select between it's immediate children, you can't do
> element.select("> .active")
>
> Best,
> -Nicolas
>
> On Dec 21, 2007 2:29 PM, Fabio <[EMAIL PROTECTED]> wrote:
> >
> > You can simply rely on the CSS child combinator.
> >
> > Instead of using
> > '#anyId .anyClass'
> > you can use
> > '#anyId > .anyClass'
> > This will look for .anyClass elements through the immediate children
> > of #anyId.
> >
> > Best,
> > Fabio
> >
> > Rob escreveu:
> >
> >
> > > This method appears to be missing something that would be quite
> > > useful.
> > > An option so that the select() method would only look through
> > > immediate children, exactly how childElements() and decendants()
> > > differ.
> > >
> > > Unless there is already a method to do this, I have not seen.. Anyone
> > > have any thoughts?
> > >
> > > Thanks
> > > Rob
> > >
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---