Jquery .css() vs JS.style
JavaScript performance comparison
Info
Show and hide element
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="testj1" style="position:absolute;top:100px;left:200px;"></div>
<div id="testj2" style="position:absolute;top:100px;left:200px;"></div>
<div id="testj3" style="position:absolute;top:100px;left:200px;"></div>
<div id="test1" style="position:absolute;top:100px;left:200px;"></div>
<div id="test2" style="position:absolute;top:100px;left:200px;"></div>
<div id="test3" style="position:absolute;top:100px;left:200px;"></div>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
jQuery 1 |
|
pending… |
jQuery 2 |
|
pending… |
jQuery 3 |
|
pending… |
Javascript |
|
pending… |
Javascript cssText |
|
pending… |
Javascript setStyle attribute |
|
pending… |
jQuery and Javascript |
|
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 Maïs
- Revision 4: published
- Revision 5: published
- Revision 6: published
- Revision 7: published by Gildas
- Revision 8: published by Nicholas A
- Revision 9: published by Nicholas A
- Revision 10: published by Nicholas A
- Revision 11: published
- Revision 12: published by totty90
- Revision 13: published
- Revision 14: published
- Revision 15: published
- Revision 16: published
- Revision 17: published
- Revision 18: published
- Revision 19: published
- Revision 20: published
0 comments