:)

To be very frank if you don't use $() and just use document.getElementById() 
that would also be faster :))

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Andrew
Kaspick
Sent: Monday, July 03, 2006 12:54 PM
To: rails-spinoffs@lists.rubyonrails.org
Subject: Re: [Rails-spinoffs] Get Elements Within ID


I would have to think that $('abc').getElementsByTagName('span') would
run faster than making use of $$.

$$ would have to evaulate the entire document.  Starting at a known
parent should be much much faster.

On 7/3/06, Maninder, Singh <[EMAIL PROTECTED]> wrote:
> How about using the $$ selector?
>
>
> Find all span elements inside <div> with id "abc".
>
>  $$('div#abc span').each(function(el) {
>    //do something
>  });
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to