$$('input').each(function(s) {
s.observe('click', makeActive);
s.observe('blur', removeActive);
}
$$('input') returns an array of input elements. You need to iterate
through them all and apply the observers.
Bernie
On Apr 24, 10:25 am, zabulus <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want the background color to change if I focus on an input field.
>
> It works when I specify $('fieldname') for example, but I want to use
> it on all the input fields on the page.
> So I used the $$('input') but that's ain't working...
>
> Anyone got a solution for this?
>
> Code:http://pastebin.com/m9691ea3
>
> Thank you.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---