body vs document (v6)

Revision 6 of this benchmark created by Max on


Description

Which is quicker with jQuery? Binding to document or 'body' ?

Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
document
var $document = $(document);
$document.click(function(e) {



}).click();
ready
body
var $body = $('body');
$body.click(function(e) {



}).click();
ready

Revisions

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