Jquery .css() vs JS.style
JavaScript performance comparison
Info
Changes the background of div#test to black. Note: Uses the latest jQuery 1.6.
Preparation code
<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.min.js"></script>
<div id="test" style="height:100px;width:100px;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 |
|
pending… |
JS |
|
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
1 comment
I don't understand what's wrong with my test. I keep getting a some error about "$" (jQuery) not being defined.