Shall we add tag name before class name

JavaScript performance comparison

Test case created by Johnson Jiang

Preparation code

<script src=""></script>
<div class="main">

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
use .class
var $main=$(".main");
use tagName.class
var $main=$("div.main");

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers


Comment form temporarily disabled.

Add a comment