body vs document (v15)

Revision 15 of this benchmark created 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
$(document).click(function(e) {



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



}).click();
ready
document.body
$(document.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.