An ID lookup is the fastest you can get to access an element. In browsers where getElementsByClassName has been implemented finding by class is also quite fast, but not as much, by ID is definitely faster.
In your example, $("p.para") would be faster if you don't require that it's a descendant of a div. From jQuery 1.3 you have to think of selectors from right to left. - ricardo On Apr 6, 4:50 pm, "mattimus5...@gmail.com" <mattimus5...@gmail.com> wrote: > Hey guys, > I was just wondering if there is a speed difference in which way you > access an element. > For example: > <div class="con"><p class="para" id="mine">Test</p></div> > > Is it faster to use $("#mine") > -or- > to access the same element using the class, such as $("div p.para") > -or- > does it not even matter??? > > Just looking for some insight, > Thanks, > Matt