aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core.js b/src/core.js
index c8b5a46da..5ccf15875 100644
--- a/src/core.js
+++ b/src/core.js
@@ -48,6 +48,11 @@ jQuery.fn = jQuery.prototype = {
return this;
}
+ // $("body"): Shortcut for quickly finding the body element
+ if ( selector === "body" && !context && document.body ) {
+ selector = document.body;
+ }
+
// Handle $(DOMElement)
if ( selector.nodeType ) {
this.context = this[0] = selector;