Programming Tips - jQuery: Should I use $('body') or $(document.body)
Date: 2016aug5
Language: javaScript
Library: jQuery
Q. jQuery: Should I use $('body') or $(document.body)
A. Use $(document.body)
'body' is a query to find all tags in the document named <body>.
While with document.body you are handing jQuery the answer.
So you'd expect it to be faster -- even if its a few more characters --
And it is.
Somebody did the tests:
https://www.sitepoint.com/jquery-body-on-document-on/