$.css() v. style.property (v7)

Revision 7 of this benchmark created on


Description

Read more about why I needed/wanted to figure this out on my blooooggggg

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="testme">
</div>
<script>
  $testme = $('#x');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
$.css()
$testme.css('left', 300);
ready
style.property
$testme[0].style.left = '300px';
ready
$.attr()
$testme.attr('style', 'left: 300px;');
ready
full native setAttribute
document.getElementById("testme").setAttribute('style', 'left: 300px;');
ready
full native style.left
document.getElementById("testme").style.left = "300px";
ready

Revisions

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