id regex vs class
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<input id="txtName1" name="txtName1" class="jName" type="text" />
<input id="txtName2" name="txtName2" class="jName" type="text" />
<input id="txtName3" name="txtName3" class="jName" type="text" />
<input id="txtName4" name="txtName4" class="jName" type="text" />
<input id="txtName5" name="txtName5" class="jName" type="text" />
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
id regex |
|
pending… |
class |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Gromer
- Revision 2: published by Kevin Boudloche
0 comments