Hi,

I just tested all my jQuery selectors using the jQuery Tester (http://
jquery.nodnod.net), and the results seem to "contradict" one thing I
read in a performance article: that you should descend from the
closest parent ID when using classes in your selector (the article
says "April 09", so the latest jQuery version was already available).

In my tests, using just the class selector (like span.myClass) was
always fastest (sometimes twice as fast as #myDiv span.myClass), and
this in all browsers I tested, not just the ones supporting
getElementsByClassName.

Maybe descending from the closest parent ID becomes a factor when you
have a lot of elements on you page? Any experiences?

Thanks

Reply via email to