On Oct 31, 1: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?
I would rather give those elements unique className, but if you must:
$R(1,10).each(function(n) {
$$('#container_'+ n +' span');
})
should do it.
>
> Thanks
> Matt
[snip]
--
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
-~----------~----~----~----~------~----~------~--~---