David Dashifen Kees wrote:
> The reason the first block of code doesn't work is that invoke() works 
> on methods of an object.  Because your checked() function isn't a method 
> of the Element object, invoke isn't what you want.  This should work, 
> though:
>
>     function checked(element) {
>         element.checked = !element.checked;
>         return element;
>     }
>
>     $("article").getInputs("checkbox").each(function(element) {
>     checked(element) });
>
>   
Oops!  Even simpler....

$("article").getInputs("checkbox").each(checked);

Yes, what you wanted was exactly each() not invoke().  Also, your checked 
function need not return anything.

--Ken Snyder



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to