jQuery Class Selectors: With or Without tagname?
<p>I'm trying to find a definitive answer to the old question "should i use a tag name when selecting with a class?"</p>

<p>Everywhere i look on the web for jQuery best practices, there is nearly always a point of using jQuery("tag.className"); because this uses getElementByTagName first.</p>

<p>So I've set up a benchmark on jsPerf to check. I've used the source markup from my website so its more of a real world test and run the benchmark on all modern browsers and apart from Chrome and Opera, all the other modern browsers say that jQuery(".className"); is an order of magnitude faster even though this goes against nearly everything i've read in books and tutorials online. I assume its faster because those browsers support getElementByClassName natively.</p>

<p>Here's the benchmark:</p>

<p><a href="http://jsperf.com/length-detection" rel="nofollow">http://jsperf.com/length-detection</a></p>

<p>What do you think is best?</p>

<p>Many thanks</p>

<p>Chris</p>
