jQuery Select class after id
JavaScript performance comparison
Info
Fastest way to select elements with a class when they are child of an id
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div>
<div id='a'>
<p>
adqqw sa q dq
</p>
<div>
asdadadasdas adad asd
<div class='b'>
THasdadsda
</div>
</div>
</div>
<div>
Preparation code output
adqqw sa q dq
asdadadasdas adad asd
THasdadsda
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
One Select |
|
pending… |
2 selectors |
|
pending… |
Child |
|
pending… |
|
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 Thomas Genin
- Revision 2: published
0 comments