How to: Optimize your jQuery selectors

by: Stéphane Caron

Simple selectors

Firefox: 0.350ms, 19 calls

Firefox: 0.350ms, 19 calls

Firefox: 0.450ms, 22 calls

Firefox: 0.500ms, 27 calls

Position selectors

Firefox: 0.550ms, 22 calls

Firefox: 0.730ms, 37 calls

Firefox: 0.800ms, 40 calls

Firefox: 0.730ms, 41 calls

Firefox: 0.730ms, 41 calls

ID selectors

Firefox: 0.100ms, 4 calls

© St├ęphane Caron 2008