JulienW 13 December 2011 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.
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.