I guess that in reading the summary pages for the Utility Functions I
got the impression that this method was reliant on CSS classes
assigned to elements. *sheepish grin*
Looking at the detailed description of the $$() method now, this
probably will do what I want... time to get to work and experiment.
Thanks!
G
On Mar 5, 7:21 pm, kangax <[EMAIL PROTECTED]> wrote:
> What's wrong with $$ helper?
>
> $$('[name=removeIcons]'); // document wide
>
> //or
>
> someForm.select('[name=someName]'); // down from some element
>
> http://www.prototypejs.org/api/utility/dollar-dollar
>
> - kangax
>
> On Mar 5, 6:44 pm, "J. Gregory Wright" <[EMAIL PROTECTED]> wrote:
>
>
>
> > As in, is there one in the core Prototype implementation? Since $
> > (name) should map to a single element in the document (because each
> > 'id' attribute value should be unique since it is used by CSS),
> > shouldn't you be able to have the same kind of access for retrieving
> > multiple document elements with the same name, such as:
>
> > function $N(element) {
> > var elements = new Array();
> > if (arguments.length == 1) {
> > elements = document.getElementsByName(element).collect(function(e)
> > {
> > return Element.extend(e);
> > });
> > }
> > return elements;
>
> > }
>
> > such that:
>
> > var removers = $N('removeIcons');
>
> > would return an array of extended elements whose HTML name attribute
> > is 'removeIcons'.
>
> > Inquiring minds...
>
> On Mar 5, 6:44 pm, "J. Gregory Wright" <[EMAIL PROTECTED]> wrote:
>
> > As in, is there one in the core Prototype implementation? Since $
> > (name) should map to a single element in the document (because each
> > 'id' attribute value should be unique since it is used by CSS),
> > shouldn't you be able to have the same kind of access for retrieving
> > multiple document elements with the same name, such as:
>
> > function $N(element) {
> > var elements = new Array();
> > if (arguments.length == 1) {
> > elements = document.getElementsByName(element).collect(function(e)
> > {
> > return Element.extend(e);
> > });
> > }
> > return elements;
>
> > }
>
> > such that:
>
> > var removers = $N('removeIcons');
>
> > would return an array of extended elements whose HTML name attribute
> > is 'removeIcons'.
>
> > Inquiring minds...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---