Skip to content

24 ways to impress your friends

Vote down?

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.