In jQuery, is selecting by class or id faster than selecting by some other attribute?

Viewed 37886

Basically, is

$("#someid")

or

$(".someclass")

faster than

$("[someattr='value']")

I would imagine that it is (that is, selection by id is fastest, then class, then attribute), but does anyone know for sure?

6 Answers
Related