24 ways to impress your friends

Jump to menu

Vote up?

JulienW

As seen on this jsperf testcase : http://jsperf.com/various-jquery-testcases

This is also way faster to use :

$(document.getElementById(“foo”));

than

$(”#foo”);

But really, is it really so important ? Most of the time, you just cache the result of the selector in a var once, and use it after this.