What is the Relative Performance of Pseudo-Class and Custom Selectors?

Posted by James Wiseman on Stack Overflow See other posts from Stack Overflow or by James Wiseman
Published on 2010-04-16T11:54:18Z Indexed on 2010/04/16 12:13 UTC
Read the original article Hit count: 725

It's my understanding that, in terms of selector speed, that #ID selectors are fastest, followed by element selectors, and then .class selectors.

I have always assumed that pseudo-class selectors and custom selectors (those in the form ':selector') are similar to .class selectors, but I realised that I'm just not sure.

I realise that this does depend on the complexity of the code within the pseudo-class/custom selector, so I guess I'd like to know the answer with this excluded as factor.

Any help would be appreciated.

Thanks.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-selectors