jQuery.attr('style', value) vs. native DOM (v28)

Revision 28 of this benchmark created on


Preparation HTML

<div id="box">I'm a box</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>

Setup

var el = document.getElementById("box");

Teardown



            el = null;
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery.css()
$(el).attr('style', 'background: #FF0000;');
ready
Native DOM
el.style.background = "#FF0000";
ready

Revisions

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