Chaining-jquery

Benchmark created on


Preparation HTML

<script src="//code.jquery.com/jquery-1.6.4.min.js"></script>
<div id="item"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
NoChaining
$('#item').css ('color', 'black');
$('#item').html ('test');
$('#item').css ('background-color', 'red');
ready
Chaining
$('#item').css ('color', 'black').html ('test').css ('background-color', 'red');
ready
Cache
var item = $('#item');
item.css ('color', 'black');
item.html ('test');
item.css ('background-color', 'red');
ready

Revisions

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