On 7.3.2008, at 18.51, Walter Lee Davis <[EMAIL PROTECTED]> wrote:
>
> Is there a way you could change the identifier to a classname?
>
> $$('div.myClass') always returns an array, even if it's an array of
> one.
>
$$('#dynamic div') does the same without the need to assign classes to
the individual list elements. The rule of thumb is that $ returns a
single element and $$ an array of elements. invoke is an array method.
//jarkko
> Walter
>
> On Mar 7, 2008, at 11:42 AM, Tarscher wrote:
>
>>
>> Hi all,
>>
>> I have a dynamic list of divs I want to add a class to:
>> $('dynamic').invoke('addClassName', 'border')
>>
>> The list can also only contain 1 div resulting in a unknown function
>> addClassName . Is this caused by the fact that there is only 1 div?
>> Is
>> there a way around this?
>>
>> thanks
>> Stijn
>>>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---