Dirk Eschler wrote:
> Am Mittwoch, 7. Juni 2006 11:54 schrieb Maninder, Singh:
> [...]
>>   Example: Find all <img> elements inside <p> elements with class
>> "summary", all inside the <div> with id "page". Hide each matched <img>
>> tag.
>>
>>   $$('div#page p.summary img').each(Element.hide)
> 
> Out of curiosity, how does the Element method know about the iterator? 
> Somehow 
> i had expected that Element.hide() takes a param.

Element.hide is different from Element.hide(). The first is a subroutine (each()
takes a subroutine as a param and then passes the current iteration to it), the
second executes the subroutine.

-- 
Michael Peters
Developer
Plus Three, LP

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to