Excellent answers thanks! Could i just ask one more thats just cropped
up.....how do i add an id to an element i've just created....i've just
done:
var aTag = document.createElement('a');
Element.extend(aTag);
aTag.addClassName('selectelement');
I want to add an id to aTag.
thanks again
On Jan 23, 8:47 pm, "Dan Dorman" <[EMAIL PROTECTED]> wrote:
> On Jan 23, 2008 1:27 PM, elduderino <[EMAIL PROTECTED]> wrote:
>
>
>
> > Does using the $$ give extend an element like $ does?
>
> Yep!
>
> Keep in mind, though, that $$ is returns an array of elements--even if
> the selector you provide only matches one element, you'll still get an
> array holding that single element. In that case, you'll want to grab
> the element thusly: $$(selector)[0] or $$(selector).first(). That
> accesses the fully Prototype-extended element.
>
> The Protoype API docs have some good info, as usual:
> <http://www.prototypejs.org/api/utility/dollar-dollar>
>
> Hope that helps!
>
> :Dan
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---