jQuery CSS vs Width vs Native Width (v2)

Revision 2 of this benchmark created on


Preparation HTML

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

Setup

var target = $("#target");

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery CSS function
target.css("width");
ready
jQuery Width function
target.width();
ready
Native inline styling
target[0].style.width;
ready

Revisions

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