I asked that question a few days ago, so i will pass the knowledge :)

>
> 1, $('#id')
calls the javascript function getElementById so that is the fastest.
> 2, $('tag#id')
is slow because jquery gets all the tags first and then searches for the id
>
> 3, $('.class',context)
the performance depends on the context
> 4, $('#id .class')
> 5, $('.class1 .class2')
4 is faster than 5 because of the getElementById function

This is was i understood from the answers. Correct me if i made a 
mistake somewhere.


David



_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to