I'm thinking $$(eval('#container_'+boxID+' span'));
Don't know if it's the right thing to do though.

Cheers

Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Fri, Oct 31, 2008 at 2:21 PM, Matt <[EMAIL PROTECTED]> wrote:

>
> Thanks kangax, that worked well.
>
> One question: since I'm working with dynamically-generated code, is
> there some way I can concatenate variable names? For instance, this
> code is working in a function, so I actually want to use an ID number
> to identify #container. I've tried something like:
>
> $$('#container_'+boxID+' span');
>
> in order to end up with:
>
> $$('#container_1 span');
> $$('#container_2 span');
> $$('#container_3 span');
> etc
>
> but this just prints the string out literally. How can I embed the
> variables in there?
>
> Thanks
> Matt
>
> On Oct 31, 4:50 pm, kangax <[EMAIL PROTECTED]> wrote:
> > $$('#container span').length === $$('#container span.on').length
> >
> > // or a bit more effecient
> >
> > $$('#container span').all(function(el){ return
> > el.hasClassName('on') });
> >
> > --
> > kangax
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to